summaryrefslogtreecommitdiff
path: root/tests/suite/foundations/float.typ
diff options
context:
space:
mode:
authorPgBiel <9021226+PgBiel@users.noreply.github.com>2024-09-26 08:39:37 -0300
committerGitHub <noreply@github.com>2024-09-26 11:39:37 +0000
commit320c28844f4e2686ab1bedfc507c9c7babafed63 (patch)
tree1fc37697db5d7bf615f55700589668d862ea342e /tests/suite/foundations/float.typ
parenta69ada7889c5c5996d0660401e981b6baac14a83 (diff)
Fixed-point decimal type (#4900)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'tests/suite/foundations/float.typ')
-rw-r--r--tests/suite/foundations/float.typ34
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.