Fixed incorrect division results

This commit is contained in:
Eduard Urbach 2025-02-22 12:54:23 +01:00
parent 65b74046e1
commit a75aad52f6
Signed by: eduard
GPG key ID: 49226B848C78F6C8
11 changed files with 150 additions and 94 deletions

View file

@ -0,0 +1,30 @@
main() {
number(10)
register(10)
}
number(x int) {
y := x
x -= 1
assert x < y
x += 1
assert x == y
x *= 2
assert x > y
x /= 2
assert x == y
}
register(x int) {
y := x
num := 1
x -= num
assert x < y
x += num
assert x == y
num = 2
x *= num
assert x > y
x /= num
assert x == y
}