Modulo Java. First, let us discuss how the operator works. Modulo operator is an arithmetical operator which is denoted by %.
Modulo is also referred to as 'mod.' the standard format for mod is: When the first operand is a negative value, the return value will always be negative, and vice versa for positive values. But it will be close to the value 1.8.
Use the % operator to calculate the mod of two number in java the modulus or modulo operator returns the remainder of the two integers after division.
This operator returns the remainder left over when one operand is divided by a second operand. So, as you now understand, the modulus operator gives the remainder of the division. When the first operand is a negative value, the return value will always be negative, and vice versa for positive values. Modulo operator is an arithmetical operator which is denoted by %.
Nessun commento:
Posta un commento