Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

intermittent rounding errors #2

dominictarr opened this Issue · 2 comments

3 participants

Dominic Tarr Florent Jaby Tim Caswell
Dominic Tarr

some times numbers don't come out exactly like they came in...

it's only the smallest end of the scale, but still important.

strangely, it only happens sometimes.

Florent Jaby

Hey, i was just passing through and saw this issue.
I would say it comes from the fact that Floats are floating point numbers in Javascript. This causes some inaccuracies for some numbers.
here's where i found it

Tim Caswell

I guess this is because of how I parse numbers character-by-character using math. I guess the alternative would be to store the number as a string and parseFloat it at the end. Either way, it's probably not good to depend on floats for exact values for the reasons @floby pointed out.

Martin Raifer tyrasd referenced this issue in tyrasd/osmtogeojson

CLI crashes on JSON files > ~256MB #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.