> The binary arithmetic operators are +, -, *, /, and the modulus operator %.
https://archive.org/details/TheCProgrammingLanguageFirstEdit...
At least, that was the C reference I used in college.
> The binary arithmetic operators are +, -, *, /, and the modulus operator %.
https://archive.org/details/TheCProgrammingLanguageFirstEdit...
At least, that was the C reference I used in college.
The draft version "X3.???-1988" at https://web.archive.org/web/20161223125339/http://flash-gord... (linked-to from Wikipedia) has:
> % modulus operator: 3.3.5
which seems off to a good start for K&R, but then also has:
> remainder operator, %, 3.3.5
and 3.3.5 says "the result of the % operator is the remainder" -- not a whiff of a modulus present there.
Thanks!
You will find "modulus operator" to refer to % in C in all of the above (other than the standard).
The more something gets repeated from person to person, the higher chance that somewhere in that chain, somebody screwed up. That's why people like professors, people who run YouTube programming channels, people who answer C questions on Stack Overflow, etc. should generally strive to cut down the number of links in the chain.
edit: tertiary -> ternary
Calling it "Ayers Rock" privileges some guy from the 19th century, calling it "Uluru" privileges a bunch of people who lived near it for longer than that, the rock itself has no opinion (and also doesn't believe anything about ritual magic, property law, gender based taboos, or the tourist industry)
Now, John Carmack is a little different because John is a person and it is rude to use names people don't like. But it isn't impossible, it's just rude. Calling the previous President of the United States of America "Tangerine Palpatine" works just fine - we both know who I meant. In fact it's a little weird that our culture has parents assign to their children full legal names, only kinda-sorta making it possible for them to choose for themselves later, the Culture's habit of allowing children to pick one of their names as part of growing up seems better.
It goes on to say: "x % y produces the remainder when x is divided by y" and that "the sign of the result for % are machine-dependent for negative operands, as is the action taken on overflow or underflow".
The binary operator / indicates division. When positive integers are divided, truncation is toward 0, but the form of truncation is machine-dependent if either operand is negative. On all machines covered by this manual, the remainder has the same sign as the dividend. It is always true that (a/b)*b + a%b is equal to a (if b is not 0). The binary % operator yields the remainder from division of the first operand by the second.