Open jadoc opened 3 months ago
The output is represented in double precision floating point values, which have a limited number of digits of precision (53 bits, which is around 15-17 decimal digits, meaning that the largest integer that can be represented exactly is 9007199254740992
)
Probably a duplicate of:
If anything, this is a duplicate of #32106, which was erroneously labeled as "enhancement".
I have proposed a fix in #95349. PTAL
At the advice of @AThousandShips, I'm breaking up my pull request into smaller, easier to review chunks. I'm starting with the creating unit tests to capture the existing Range
functionally in #95884.
Tested versions
System information
Godot v4.2.2.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated AMD Radeon RX 6900 XT (Advanced Micro Devices, Inc.; 32.0.11021.1011) - 12th Gen Intel(R) Core(TM) i7-12700K (20 Threads)
Issue description
When displaying the values of integers, the GDScript debugger will show incorrect values when the integer is greater than
9223372036854775800
or less than-9223372036854775800
. Indeed, the debugger will simply limit itself to those two values when the threshold is exceeded.Integers in GDScript are documented to support values between
-9223372036854775808
and9223372036854775807
. The behavior of GDScript itself appears to be correct, as printing integers containing those maximum and minimum values produces the correct output.Steps to reproduce
In the following function, insert a breakpoint before the first
print()
statement. Run the script in debug mode, and examine the values ofvery_large
andvery_negative
in the debugger. Compare what's displayed in the debugger to the output produced by theprint()
statements.Minimal reproduction project (MRP)
large-int-repro.zip