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

to improve performance: do not use BigDecimal for rounding #938

Merged
merged 1 commit into from
Dec 13, 2018

Conversation

osana
Copy link
Contributor

@osana osana commented Dec 12, 2018

closes #932

@osana osana force-pushed the osana-rounding branch 3 times, most recently from 87326b3 to d7ccecf Compare December 13, 2018 04:01
Copy link
Member

@LukasPaczos LukasPaczos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! One note that'd be great to address, but not a blocker.

* @return trimmed value
*/
public static double trim(double value) {
return Math.round(value * 10000000.0) / 10000000.0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do a check for infinity overflow here after multiplication and throw an exception if it occurs?

@osana osana merged commit f80e493 into master Dec 13, 2018
@osana osana deleted the osana-rounding branch December 13, 2018 16:37
@osana osana mentioned this pull request Dec 18, 2018
14 tasks
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

Successfully merging this pull request may close these issues.

Geometry toJson() is very slow
2 participants