mod

mod, operator

Returns the remainder of integer division: a mod b.

Examples

table T = with
  [| as A, as B |]
  [| 7, 2 |]
  [| 10, 3 |]

T.R = T.A mod T.B

show table "Mod" with
  T.A
  T.B
  T.R

This produces the following table:

A B R
7 2 1
10 3 1

Errors

b must be a strictly positive integer.

User Contributed Notes
0 notes + add a note