diff options
Diffstat (limited to 'tests/suite/foundations/float.typ')
| -rw-r--r-- | tests/suite/foundations/float.typ | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/tests/suite/foundations/float.typ b/tests/suite/foundations/float.typ index 67d4acbf..2e9e07f2 100644 --- a/tests/suite/foundations/float.typ +++ b/tests/suite/foundations/float.typ @@ -6,10 +6,14 @@ #test(float("3.1415"), 3.1415) #test(float("-7654.321"), -7654.321) #test(float("\u{2212}7654.321"), -7654.321) +#test(float(decimal("4.89")), 4.89) +#test(float(decimal("3.1234567891234567891234567891")), 3.123456789123457) +#test(float(decimal("79228162514264337593543950335")), 79228162514264340000000000000.0) +#test(float(decimal("-79228162514264337593543950335")), -79228162514264340000000000000.0) #test(type(float(10)), float) --- float-constructor-bad-type --- -// Error: 8-13 expected float, boolean, integer, ratio, or string, found type +// Error: 8-13 expected float, boolean, integer, decimal, ratio, or string, found type #float(float) --- float-constructor-bad-value --- @@ -55,20 +59,20 @@ --- float-repr --- // Test the `repr` function with floats. -#repr(12.0) \ -#repr(3.14) \ -#repr(1234567890.0) \ -#repr(0123456789.0) \ -#repr(0.0) \ -#repr(-0.0) \ -#repr(-1.0) \ -#repr(-9876543210.0) \ -#repr(-0987654321.0) \ -#repr(-3.14) \ -#repr(4.0 - 8.0) \ -#repr(float.inf) \ -#repr(-float.inf) \ -#repr(float.nan) +#test(repr(12.0), "12.0") +#test(repr(3.14), "3.14") +#test(repr(1234567890.0), "1234567890.0") +#test(repr(0123456789.0), "123456789.0") +#test(repr(0.0), "0.0") +#test(repr(-0.0), "-0.0") +#test(repr(-1.0), "-1.0") +#test(repr(-9876543210.0), "-9876543210.0") +#test(repr(-0987654321.0), "-987654321.0") +#test(repr(-3.14), "-3.14") +#test(repr(4.0 - 8.0), "-4.0") +#test(repr(float.inf), "float.inf") +#test(repr(-float.inf), "-float.inf") +#test(repr(float.nan), "float.nan") --- float-display --- // Test floats. |
