on 492ae2f help sign in
40 lines 439 B history raw
1### `++mod`
3Modulus
5Computes the remainder of dividing `a` by `b`.
7Accepts
8-------
10`a` is an atom.
12`b` is an atom.
14Produces
15--------
17An atom.
19Source
20------
22 ++ mod :: remainder
23 ~/ %mod
24 |: [a=`@`1 b=`@`1]
25 ^- @
26 ?< =(0 b)
27 (sub a (mul b (div a b)))
30Examples
31--------
33 ~zod/try=> (mod 5 2)
34 1
35 ~zod/try=> (mod 5 5)
36 0
40***