2 ms·
That depends on how the programming language implements modulo. Some don't wrap around the way you would need here when the dividend is negative. See: https://e
by munificent 3y ago
That depends on how the programming language implements modulo. Some don't wrap around the way you would need here when the dividend is negative. See: https://en.wikipedia.org/wiki/Modulo#Variants_of_the_definition https://en.wikipedia.org/wiki/Modulo#Variants_of_the_definit...
- ithkuil 3y agoWould this work in both flavours of the modulo operator? x = ((x mod 10) + 10) mod 10