kcl →
rem
Compute the remainder after dividing num
by div
.
If num
is negative, the result will be too.
rem(num: i64, divisor: i64) -> i64
Tags
math
Arguments
Name | Type | Description | Required |
---|---|---|---|
num | i64 | Yes | |
divisor | i64 | Yes |
Returns
i64
Examples
assertEqual(rem(7, 4), 3, 0.01, "remainder is 3")
assertEqual(rem(-7, 4), -3, 0.01, "remainder is 3")
assertEqual(rem(7, -4), 3, 0.01, "remainder is 3")