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

Consistently use BigDecimal.valueOf(double) *or* new BigDecimal(double) [JDBC517] #553

Closed
firebird-automations opened this issue Jan 21, 2018 · 0 comments

Comments

@firebird-automations
Copy link

Submitted by: @mrotteveel

The BigDecimal float/double conversion is a bit mixed. FBBigDecimalField and FBDecFloatField use equivalents of `BigDecimal.valueOf(double)` when setting double values, but FBFloatField and FBDoubleField use new BigDecimal(double) when getting a float/double as BigDecimal.

For consistency it might be better to use BigDecimal.valueOf(double) for both, although this may lead to a perceived loss of 'precision' for FBFloatField and FBDoubleField given the differences between the two methods of obtaining a BigDecimal from a floating point type.

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

2 participants