Skip Menu |

This queue is for tickets about the Geo-Coordinates-Converter CPAN distribution.

Report information
The Basics
Id: 80033
Status: open
Priority: 0/
Queue: Geo-Coordinates-Converter

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.13
Fixed in: (no value)



Subject: Fails on perls with nvsize != 8 (as with 64bit perls compiled with -Duselongdouble)
As per subject. Insufficient rounding in one of the tests seems to be the key to understand the issue. Floating point numbers should never be compared on string equality. Sample fail report: http://www.cpantesters.org/cpan/report/23757281 From there: # Failed test at t/21_format_iso6709.t line 33. # got: '+352138.9999999999998839+1384338.999999999999978/' # expected: '+352138.9999999998672+1384338.9999999999714/' HTH&&Regards,
Frankly, I think the precision challenges in this module are pretty serious. Consider: use Geo::Coordinates::Converter::Point::ISO6709; use Geo::Coordinates::Converter::Format::ISO6709; my $str = '+352139+1384339/'; my $point = Geo::Coordinates::Converter::Format::ISO6709->to( Geo::Coordinates::Converter::Point::ISO6709->new({ iso6709 => $str, }) ); $point->format('dms'); Geo::Coordinates::Converter::Format::ISO6709->from($point); say $point->iso6709; The output is: +352138.9999999998672+1384338.9999999999714/ I think you would be better off redesigning the module to retain the degrees, minutes, and seconds, individually if you started out with them, and only fall back on division when you need to convert to degrees.