From e1ecb8cabe2661c639fbdfe1ebcdbb0263dac8e7 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 1 Apr 2023 23:26:58 +0200 Subject: Simplify `pow` function --- tests/typ/compute/calc.typ | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') diff --git a/tests/typ/compute/calc.typ b/tests/typ/compute/calc.typ index ee063707..51569f7a 100644 --- a/tests/typ/compute/calc.typ +++ b/tests/typ/compute/calc.typ @@ -76,6 +76,23 @@ #test(calc.max(-3, 11), 11) #test(calc.min("hi"), "hi") +--- +// Test the `calc` function. +#test(calc.pow(10, 0), 1) +#test(calc.pow(2, 4), 16) + +--- +// Error: 10-16 zero to the power of zero is undefined +#calc.pow(0, 0) + +--- +// Error: 14-31 exponent is too large +#calc.pow(2, 10000000000000000) + +--- +// Error: 14-36 exponent may not be NaN, infinite, or subnormal +#calc.pow(2, calc.pow(2.0, 10000.0)) + --- // Error: 10-12 expected at least one value #calc.min() -- cgit v1.2.3