Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 49059
Status: rejected
Priority: 0/
Queue: Geo-Distance

People
Owner: Nobody in particular
Requestors: codepoet [...] umiacs.umd.edu
Cc:
AdminCc:

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



Subject: Square root of negative value
Date: Thu, 27 Aug 2009 02:34:48 -0400 (EDT)
To: bug-Geo-Distance [...] rt.cpan.org
From: Mike Lieberman <codepoet [...] umiacs.umd.edu>
Hello, Thanks for a very useful module. I have noticed that certain values of the latitude and longitude cause Geo::Distance to attempt a negative square root when using the Haversine formula. For example, the following: my $geo = Geo::Distance->new; $geo->distance("mile", 175, 12, -5, -12); Produces this: Can't take sqrt of -2.22045e-16 at Geo/Distance.pm line 259. I suspect this is some floating-point error happening but I don't know of a good way to fix it - maybe adding some small epsilon to each coordinate if they sum to 180? I am using perl 5.10 on Linux 2.6.28. Best, Mike Lieberman
Subject: Re: [rt.cpan.org #49059] Square root of negative value
Date: Thu, 27 Aug 2009 14:51:33 -0700
To: bug-Geo-Distance [...] rt.cpan.org
From: Aran Deltac <aran [...] arandeltac.com>
Hey Mike, thats for the bug report. I'll take a look at this soon and see what I can do. We now have 4 versions of most of the algorithms (Geo::Distance, Geo::Distance::Fast, GIS::Distance, GIS::Distance::Fast), so I'll check which of these has this issue and figure out a fix. Thanks again! Aran On Wed, Aug 26, 2009 at 11:35 PM, Mike Lieberman via RT < bug-Geo-Distance@rt.cpan.org> wrote: Show quoted text
> Thu Aug 27 02:35:20 2009: Request 49059 was acted upon. > Transaction: Ticket created by codepoet@umiacs.umd.edu > Queue: Geo-Distance > Subject: Square root of negative value > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: codepoet@umiacs.umd.edu > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=49059 > > > > Hello, > > Thanks for a very useful module. I have noticed that certain values of > the latitude and longitude cause Geo::Distance to attempt a negative > square root when using the Haversine formula. For example, the following: > my $geo = Geo::Distance->new; > $geo->distance("mile", 175, 12, -5, -12); > > Produces this: > Can't take sqrt of -2.22045e-16 at Geo/Distance.pm line 259. > > I suspect this is some floating-point error happening but I don't know of > a good way to fix it - maybe adding some small epsilon to each coordinate > if they sum to 180? I am using perl 5.10 on Linux 2.6.28. > > Best, > Mike Lieberman > >