dcmicoltacespedes
2020-6-23 20:01:29
Hello, I have a question, what is the difference between remainder
and modulo
? thanks
samth
2020-6-23 20:03:10
> (modulo 10 -3)
-2
> (remainder 10 -3)
1
dcmicoltacespedes
2020-6-23 20:05:03
Oh ok. So, remainder
only return positive numbers, right?
badkins
2020-6-23 20:06:10
Not necessarily: > (remainder -10 3)
-1
badkins
2020-6-23 20:07:03
remainder
returns a value with the same sign as the first argument, modulo
returns a value with the same sign as the second argument.