Kotlin Mod ✅

// Verification of modulo property: // -5 ≡ 1 (mod 3) because -5 - 1 = -6, which is divisible by 3.

// Verification of remainder property: // a = (a/b)*b + r // -5 = (-5/3)*3 + (-2) -> -5 = (-1)*3 + (-2) = -5 ✓ kotlin mod

Manually fixing a negative remainder:

(-5).mod(3) = 1 3. Implementation and Behavior Analysis The following Kotlin code demonstrates the functional difference: // Verification of modulo property: // -5 ≡

fun main() val dividend = -5 val divisor = 3 println("Remainder (%.rem()): $dividend.rem(divisor)") // Output: -2 println("Modulo (.mod()): $dividend.mod(divisor)") // Output: 1 kotlin mod