Why is operator% referred to as the “modulus” operator instead of the “remainder” operator?
问题 Today at work I had an interesting discussion with one of my coworkers. He was surprised when he had the following happen to him: assert(-1 % 10 == -1) //Expecting 9 So when he came to ask me about it, I told him "well, that makes sense. When you divide -1 by 10, you get 0 with -1 remaining. His argument however was that the modulus operator is supposed to hold true to the "always positive" model. I did a little research and found that the modulus he was referring to looks like this: Let q be