3 ms·
I suspect this is why the topic is relatively obscure; situations where you have a negative divisor and need the remainder/mod are not common.
by userbinator 8y ago
I suspect this is why the topic is relatively obscure; situations where you have a negative divisor and need the remainder/mod are not common.
- chii 8y ago> situations where you have a negative divisor and need the remainder/mod are not common. yep. But sometimes, when you have numbers that come from some external system, and you didn't check them or expect that the % operator will make it positive, you end up with this sort of problem. Such as having negative positions with CSS, or a game where you end up with negative values for coordinates.