+ 2
-2%10=8 can someone explain this equation with real life example and can you use this expression in programming
Just stumbled across this equation. Curious about how should i use this expression in a program
5 Réponses
+ 4
Generally, for
x%m, where x<0, x%m=m-(-x%m)
+ 4
You know -10/10=1, so -10%10=0
Now, apply this:
-2%10=(-10+8)%10=0+8%10=8
+ 4
Yes.
Precisely what I lengthily explained
+ 1
(-10+8)%10=-2%10
This one right
+ 1
Thanks now understand it