Live data from Hacker News

The lat/lon floating point delusion

datafix.com.au

1–10 of 154 posts

Re: The lat/lon floating point delusion

#2
Did the author think about the implementation? If we assign semantic meaning to the number of decimal points, now we also need to store the number of significant digits side by side with the actual number. We shouldn't round off internally because we might use it in as an intermediate result in a calculation.

Re: The lat/lon floating point delusion

#3
Not just lat/lon. I find myself amused when The Washington Post's education columnist Jay Matthews--quite a sharp guy from all I can tell--runs his high school "challenge index" (AP tests taken / size of graduating class) out to six decimal points for small schools. Somebody give that man a slide rule.

Re: The lat/lon floating point delusion

#5
post #2

Did the author think about the implementation? If we assign semantic meaning to the number of decimal points, now we also need to store the number of significant digits side by side with the actual number. We shouldn't round off internally because we might use it in as an intermediate result in a calculation.

You don't need to store anything extra if you are just filtering down to a standard number of digits on output.

Re: The lat/lon floating point delusion

#7
post #2

Did the author think about the implementation? If we assign semantic meaning to the number of decimal points, now we also need to store the number of significant digits side by side with the actual number. We shouldn't round off internally because we might use it in as an intermediate result in a calculation.

> We shouldn't round off internally because we might use it in as an intermediate result in a calculation.

Only if the precision is meaningful. The author's point is that it isn't for geographical coordinates.

Re: The lat/lon floating point delusion

#8
I find it hard to get that worked up about this. The positions are accurate at least, and if you're really so hard up for space that saving a couple of digits is going to make all the difference then you can think about it for 5 mins and choose a precision/storage trade off that's appropriate for you.

Re: The lat/lon floating point delusion

#10
post #6

When you completely run out of things to complain about.

That's pretty much what I was thinking as well. It's funny and an enjoyable read, but at the same time it's a complete non-issue. Unless you have some application that chokes on that many decimal places AND can't do any sort of input sanitation, why worry about it?
Post reply on HN