You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
myitcv
changed the title
Loss of Precision in Arithmetic Operations on 35-Digit Integers
eval: loss of Precision in Arithmetic Operations on 35-Digit Integers
Feb 27, 2025
Thanks for the report @takonomura. Please can you provide some context in which you are running into this? For example, is this a financial application?
I will let @mpvl reply here in the first instance regarding CUE's choice to drop down to float here.
But for now just link #1883. And further note that at least I have wondered if there is a place for a mode of CUE which use math/big or similar for all computations, with an acceptance in such a mode that performance will be impacted.
Please can you provide some context in which you are running into this?
I am trying to perform arithmetic operations on IP addresses by adapting the method described at #3142 (comment). The approach works well for IPv4 addresses (32-bit, 10 digits), but I encountered an issue when applying the same method to IPv6 addresses (128-bit, 39 digits).
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest stable release?
Yes
What did you do?
What did you expect to see?
I expected the test to pass.
According to https://cuelang.org/docs/reference/spec/#numeric-values, I expected arithmetic operations on integer values to be performed with at least 256-bit precision.
What did you see instead?
The text was updated successfully, but these errors were encountered: