diff options
| author | Martin Haug <mhaug@live.de> | 2022-02-02 20:56:40 +0100 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2022-02-03 11:32:16 +0100 |
| commit | 3f76aadb1ad8735ccd879a0b4797dabddc257896 (patch) | |
| tree | 51466b8a1c45c169f1caf34ce15311b73cb225f8 /tests | |
| parent | e6a0447f9df43aa140affbcc1ad371ea2f362496 (diff) | |
Add modulo
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/typ/utility/math.typ | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/typ/utility/math.typ b/tests/typ/utility/math.typ index 705db937..edbbd682 100644 --- a/tests/typ/utility/math.typ +++ b/tests/typ/utility/math.typ @@ -19,6 +19,22 @@ #test(even(-11), false) --- +// Test the `mod` function. +#test(mod(1, 1), 0) +#test(mod(5, 3), 2) +#test(mod(5, -3), 2) +#test(mod(22.5, 10), 2.5) +#test(mod(9, 4.5), 0) + +--- +// Error: 9-10 divisor must not be zero +#mod(5, 0) + +--- +// Error: 11-14 divisor must not be zero +#mod(3.0, 0.0) + +--- // Error: 6-16 cannot take absolute value of a linear #abs(10pt + 50%) |
