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

Integer rounding bug. #33

Open
GoogleCodeExporter opened this issue Jul 29, 2015 · 0 comments
Open

Integer rounding bug. #33

GoogleCodeExporter opened this issue Jul 29, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link
Contributor

In some rare cases the function new Integer((int) value) in the toNumber(double 
value) function works wrong. 

When I debug it, I got 2.999999 for the value and when you simple cast it to 
(int) it will be 2. 

Instead, I changed the line into this and it works very good. 
                                return new Integer((int) Math.round(value));


Original issue reported on code.google.com by [email protected] on 13 Mar 2014 at 12:34

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

No branches or pull requests

1 participant