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

toStringAsExponential returns INFINITY #48

Closed
canastro opened this issue May 28, 2021 · 3 comments
Closed

toStringAsExponential returns INFINITY #48

canastro opened this issue May 28, 2021 · 3 comments

Comments

@canastro
Copy link
Contributor

Given: value = Decimal.parse('1.7976931348623157e+310')
When: value.toStringAsExponential(10)
Then: Infinity
Expected: In my specific Use case I was expecting Decimal.parse('1.7976931348623157e+310').isInfinite to be true, but I guess that if the toStringAsExponential(10) returned 1.7976931348e+310 that would be expected as well.

PS: the limit seems to be Decimal.parse('1.7976931348623158e+308').toStringAsExponential(10)

@a14n
Copy link
Owner

a14n commented May 28, 2021

For now toStringAsExponential relays on double.toStringAsExponential and is limited to double.maxFinite (1.7976931348623157e+308)

@canastro
Copy link
Contributor Author

Thanks for your quick answers!

For the time being that limit is actually ok for my use-case. Feel free to close it if you want or to leave it open if you feel that this is something that this lib will be able to handle.

@a14n a14n closed this as completed in e3f6e69 Dec 22, 2021
@a14n
Copy link
Owner

a14n commented Dec 22, 2021

Fixed in 2.1.0

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

2 participants