Fixed incorrect division results
This commit is contained in:
parent
7598411c8f
commit
c088697446
11 changed files with 150 additions and 94 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue