-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Arithmetic overflow in BigDecimal #10502
Comments
The overflow comes from the fact that at https://github.com/crystal-lang/crystal/blob/master/src/big/big_decimal.cr#L210 ,
It seems it's a bug that was always present in BigDecimal implementation. |
I was looking into this bug because I also encountered the unhandled exception. I think the underlying problem is beyond the Before anyone picks up this issue, why did we choose |
The data type was already UInt64 in the first commit that brought the BigDecimal implementation to Crystal: bc54aa0 It even references https://github.com/akubera/bigdecimal-rs as source of inspiration, but for some reason the scale type was changed to unsigned. Probably just a mistake and we should change it to |
Otoh, |
👆 Fixing |
I'm a newbie 👋 |
I got these values when represented Bresenham's algorithm. Reduced as possible.
Provides an error:
Carc (Crystal 0.36.1).
Tested against modern compiler too:
The text was updated successfully, but these errors were encountered: