math.big addition yields incorrect results #22310
Labels
Bug
This tag is applied to issues which reports bugs.
Modules: math.big
Bugs related to the `math.big` module.
Status: Confirmed
This bug has been confirmed to be valid by a contributor.
Describe the bug
When trying to do basic arithmetic using big integers, it often returns results with the signs inverted or numbers being added when they should have been subtracted
Reproduction Steps
output is
-199
Expected Behavior
the above code to return 199
Current Behavior
it returns -199
Possible Solution
No response
Additional Information/Context
No response
V version
0.4.7 be1bb60.9a0f4d8
Environment details (OS name and version, etc.)
V full version: V 0.4.7 be1bb60.9a0f4d8
OS: linux, "Arch Linux"
Processor: 12 cpus, 64bit, little endian, AMD Ryzen 5 7640U w/ Radeon 760M Graphics
getwd: /home/sirsegv
vexe: /home/sirsegv/.v/v
vexe mtime: 2024-09-19 13:10:00
vroot: OK, value: /home/sirsegv/.v
VMODULES: OK, value: /home/sirsegv/.vmodules
VTMP: OK, value: /tmp/v_1000
Git version: git version 2.46.1
Git vroot status: weekly.2024.07-1143-g9a0f4d84 (34 commit(s) behind V master)
.git/config present: true
CC version: cc (GCC) 14.2.1 20240910
thirdparty/tcc status: thirdparty-linux-amd64 0134e9b9
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: