C Modulo Negative. C language modulus operator with negative values: The % operator in c is not the modulo operator but the remainder operator.
In 1801 gauss published a book covering modular arithmetics. Produces the remainder when x is divided by y. It is chosen over the c behavior because a nonnegative result is often more useful.
So, take mod 3 (in c and python, it's n % 3)… starting.
This modulus operator added to arithmetic operators. In 1801 gauss published a book covering modular arithmetics. The emphasis is, sign of left operand is appended to result in case of modulus operator in c. The modulus operator (%) operator in c.
Nessun commento:
Posta un commento