I am using a method 'distance_to' from a lib returning a distance in Float type based on latitude/longitude
@ proposals.each do | proposal |
cd = proposal.distance_to(current_city) @d = cd if (@d <=> cd) > 0
end
a problem arise when the proposal latitude/longitude are equivalent to current_city latitude/longitude
in this case it returns NaN (and not 0.0.. don't know why....)
if I don't modify the lib script, how I can get bypass this results (obviously I don't care about 0.0 distance)
something like..
cd = proposal.distance_to(current_city) != NaN ? proposal.distance_to(current_city) : 0.0
As I discover it few times after my post, I spent sometime away in a ruby-church requiring forgiveness for my silly question... I also bought new glasses ;-))) before coming back crawling on the ground and raising my hands on the keyboard
thanks ;-)))
joss
···
On 2007-03-31 17:38:11 +0200, "Luis Parravicini" <lparravi@gmail.com> said:
On 3/31/07, Josselin <josselin@wanadoo.fr> wrote:
so 0.693524996891893 seems to be greater than 0.197314075476553 ???
0.693524996891893 IS greater than 0.197314075476553 !!