Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intermittent rounding errors #2

Open
dominictarr opened this issue Sep 23, 2011 · 9 comments
Open

intermittent rounding errors #2

dominictarr opened this issue Sep 23, 2011 · 9 comments

Comments

@dominictarr
Copy link

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

https://gist.github.com/1237220

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

strangely, it only happens sometimes.

@Floby
Copy link

Floby commented Aug 28, 2012

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 http://floating-point-gui.de/

@creationix
Copy link
Owner

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.

@crertel
Copy link

crertel commented Apr 10, 2015

Want a PR for this?

@RWOverdijk
Copy link

👍

@stringparser
Copy link

Same here, if no one takes the lead I'll give it a try 😸

@crertel
Copy link

crertel commented May 5, 2015

Oh wow. Totally forgot about this. I'll try to have something this week.

@stringparser
Copy link

No hurry :), recently I found this way useful to make a lightweight JSON database and was checking on things

@czzarr
Copy link

czzarr commented Dec 3, 2015

Any progress planned on this ?

@jeromew
Copy link

jeromew commented Jul 25, 2016

I believe this issue has been resolved in 1.2.0 after 044b268

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants