Begin typing your search above and press return to search.
Kotlin Mod -
The modulo operation is incredibly versatile in day-to-day programming.
Just like standard division, you cannot perform modulo by zero. This will throw an ArithmeticException . kotlin mod
// Verification of remainder property: // a = (a/b)*b + r // -5 = (-5/3)*3 + (-2) -> -5 = (-1)*3 + (-2) = -5 ✓ The modulo operation is incredibly versatile in day-to-day
(-5).rem(3) = -2