Why
-4%5 => 1 //I understand
-5%5 => 0 //I understand
-6%5 => 4 // My mind has been deleted
I checked it in c/cpp, there result is just -1.
Why
-4%5 => 1 //I understand
-5%5 => 0 //I understand
-6%5 => 4 // My mind has been deleted
I checked it in c/cpp, there result is just -1.
-6
: the biggest number that is less or equal to -6
and evenly divisible by 5
is -10
.
# just like the other examples
-4 - (-5) == 1
-5 - (-5) == 0
-6 - (-10) == 4 # fits perfectly in there
-7 - (-10) == 3
-8 - (-10) == 2