var a = 19, b = 4
b /= a
Why is this 0? Is it because 4/19 is less than a whole number?
1/4/2020 9:37:50 PM
This is Swift. When both operands are integers, division rounds the result to the nearest integer towards zero. In other words, the result is truncated.
Send us a message