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

@ -1,13 +1,11 @@
main() {
quotient := 0
remainder := 0
dividend := 256
divisor := 100
quotient, remainder = 256 / 100
quotient, remainder := 256 / 100
assert quotient == 2
assert remainder == 56
quotient, remainder = dividend / 100
assert quotient == 2
assert remainder == 56
@ -15,7 +13,7 @@ main() {
quotient, remainder = 256 / divisor
assert quotient == 2
assert remainder == 56
quotient, remainder = dividend / divisor
assert quotient == 2
assert remainder == 56