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
The first number correctly evaluated, losing precision as expected.
The second number (just adding 2 to the end) produces distorted result.
Environment
Mages 3.0.0
Windows 11
Cause
Since #110, the NumberTokenizer.AddValue method checks for some overflow cases, but not all of them. Specifically for the example number above it all goes well until the attempt to add the last digit 2:
The overflown newValue = 10303165102326565448 is larger than _value = 8409014139716477191, therefore it's not ignored.
Fix proposal
We should improve the overflow check. I will create a PR soon with a proposed fix.
The text was updated successfully, but these errors were encountered:
There is a case where Mages incorrectly tokenizes a number. Some cases were fixed in #110, but not all of them.
Steps to reproduce
Start REPL and evaluate the following numbers:
The first number correctly evaluated, losing precision as expected.
The second number (just adding
2
to the end) produces distorted result.Environment
Mages 3.0.0
Windows 11
Cause
Since #110, the

NumberTokenizer.AddValue
method checks for some overflow cases, but not all of them. Specifically for the example number above it all goes well until the attempt to add the last digit2
:The overflown
newValue = 10303165102326565448
is larger than_value = 8409014139716477191
, therefore it's not ignored.Fix proposal
We should improve the overflow check. I will create a PR soon with a proposed fix.
The text was updated successfully, but these errors were encountered: