Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - I wonder what 2%5 is?
I wonder what 2%5 is?
% is an integer remainder operation. This is a modular operation.

Both sides can only be integer constants, including positive and negative numbers.

2%5 is "2 modulo 5", quotient 0, remainder 2, and result 2.

(-9)%5 is "-9 mod 5", quotient 1, remainder -4, and result -4.

The result of the function mod(n, m) may be different from that of the mod operator.

Mod (-9,5) may get 1.