The “%%” provides a reminder of the division of the first vector with the second, and the “%/%” gives the quotient of the division of the first vector with the second.
In R, “%%” and “%/%” are both operators related to division, but they serve different purposes:
“%%” (modulo operator):
The “%%” operator calculates the remainder when one number is divided by another.
For example, a %% b gives the remainder when a is divided by b.
10 %% 3 # Result: 1 (remainder when 10 is divided by 3)
“%/%” (integer division operator):
The “%/%” operator performs integer division and returns the quotient, discarding any remainder.
For example, a %/% b gives the integer quotient when a is divided by b.
10 %/% 3 # Result: 3 (integer quotient of 10 divided by 3)
In summary:
Use “%%” to find the remainder in a division operation.
Use “%/%” to find the integer quotient in a division operation, discarding any remainder.