Re:Integers in C quiz
by kccqzy on Monday September 05, 2022 @06:26PM
(#32730235)
That's an inherent property of both the modulus interpretation and the remainder interpretation.
Haskell does it right. Instead of having operators like %, it gives the programmer choice to choose either the modulus or the remainder. Using GP's example:
Haskell does it right. Instead of having operators like %, it gives the programmer choice to choose either the modulus or the remainder. Using GP's example:
And we have both (x `quot` y)*y + (x `rem` y) == x and (x `div` y)*y + (x `mod` y) == x