summaryrefslogtreecommitdiff
path: root/tests/typ/compute
diff options
context:
space:
mode:
authorHarmoGlace <23212967+HarmoGlace@users.noreply.github.com>2023-04-20 16:09:41 +0200
committerGitHub <noreply@github.com>2023-04-20 16:09:41 +0200
commit42b93b7b534557205a6dc3dfda8fe3cfccfcc458 (patch)
tree924171b6c1299fef0b628e0ac8c89c5775fea8be /tests/typ/compute
parentc117e2dc276d19b022abccac0d252bd7fc1cd44e (diff)
Add `quo`, `trunc` and `fract` calculation methods and rename `mod` to `rem` (#890)
Diffstat (limited to 'tests/typ/compute')
-rw-r--r--tests/typ/compute/calc.typ32
1 files changed, 24 insertions, 8 deletions
diff --git a/tests/typ/compute/calc.typ b/tests/typ/compute/calc.typ
index 6af5189b..c9a37d1b 100644
--- a/tests/typ/compute/calc.typ
+++ b/tests/typ/compute/calc.typ
@@ -55,20 +55,36 @@
#test(calc.even(-11), false)
---
-// Test the `mod` function.
-#test(calc.mod(1, 1), 0)
-#test(calc.mod(5, 3), 2)
-#test(calc.mod(5, -3), 2)
-#test(calc.mod(22.5, 10), 2.5)
-#test(calc.mod(9, 4.5), 0)
+// Test the `rem` function.
+#test(calc.rem(1, 1), 0)
+#test(calc.rem(5, 3), 2)
+#test(calc.rem(5, -3), 2)
+#test(calc.rem(22.5, 10), 2.5)
+#test(calc.rem(9, 4.5), 0)
---
// Error: 14-15 divisor must not be zero
-#calc.mod(5, 0)
+#calc.rem(5, 0)
---
// Error: 16-19 divisor must not be zero
-#calc.mod(3.0, 0.0)
+#calc.rem(3.0, 0.0)
+
+---
+// Test the `quo` function.
+#test(calc.quo(1, 1), 1)
+#test(calc.quo(5, 3), 1)
+#test(calc.quo(5, -3), -1)
+#test(calc.quo(22.5, 10), 2)
+#test(calc.quo(9, 4.5), 2)
+
+---
+// Error: 14-15 divisor must not be zero
+#calc.quo(5, 0)
+
+---
+// Error: 16-19 divisor must not be zero
+#calc.quo(3.0, 0.0)
---
// Test the `min` and `max` functions.