2 ms·
> I've seen simple cases where a function returned a signed integer value modulo x. Which of course means that this function can only return a value within 0..x
by Figs 14y ago
> I've seen simple cases where a function returned a signed integer value modulo x. Which of course means that this function can only return a value within 0..x-1.
Actually, signed modulo can return negative numbers... See, for example, this StackOverflow question:
http://stackoverflow.com/questions/7594508/modulo-operator-with-negative-values http://stackoverflow.com/questions/7594508/modulo-operator-w...
- santaragolabs 14y agoHa, good catch. But in this case x was always positive.