+ 2

Modular question?

hey guys! what the answer is: 2%-8 and how?.....

30th Sep 2017, 3:07 PM
Muhammad Belal
Muhammad Belal - avatar
1 Respuesta
+ 9
The % operator returns the remainder of a division. I.e. m%n returns remainder of m/n (floor division). 2 divided by -8 is 0 with remainder of 2. Hence 2%-8 returns 2. Please use the search function for more similar questions on modulus operator.
30th Sep 2017, 4:48 PM
Hatsy Rei
Hatsy Rei - avatar