summaryrefslogtreecommitdiff
path: root/macros/luatex/latex/luacas/tex/test/expressions/luacas-rationalexponent.lua
diff options
context:
space:
mode:
Diffstat (limited to 'macros/luatex/latex/luacas/tex/test/expressions/luacas-rationalexponent.lua')
-rw-r--r--macros/luatex/latex/luacas/tex/test/expressions/luacas-rationalexponent.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/macros/luatex/latex/luacas/tex/test/expressions/luacas-rationalexponent.lua b/macros/luatex/latex/luacas/tex/test/expressions/luacas-rationalexponent.lua
new file mode 100644
index 0000000000..85690f8c66
--- /dev/null
+++ b/macros/luatex/latex/luacas/tex/test/expressions/luacas-rationalexponent.lua
@@ -0,0 +1,15 @@
+local a = BinaryOperation.POWEXP({Integer(8), Integer(1) / Integer(2)})
+local b = BinaryOperation.POWEXP({Integer(27), Integer(1) / Integer(3)})
+local c = BinaryOperation.POWEXP({Integer(36), Integer(1) / Integer(2)})
+local d = BinaryOperation.POWEXP({Integer(36264691), Integer(1) / Integer(2)})
+local e = BinaryOperation.POWEXP({Integer(357911), Integer(1) / Integer(2)})
+local f = BinaryOperation.ADDEXP({BinaryOperation.POWEXP({Integer(8), Integer(1) / Integer(2)}), BinaryOperation.POWEXP({Integer(32), Integer(1) / Integer(2)})})
+
+starttest("rational powers")
+testeq(a:autosimplify(), "(2 * (2 ^ 1/2))", a)
+testeq(b:autosimplify(), "3", b)
+testeq(c:autosimplify(), "6", c)
+testeq(d:autosimplify(), "(331 * (331 ^ 1/2))", d)
+testeq(e:autosimplify(), "(71 * (71 ^ 1/2))", e)
+testeq(f:autosimplify(), "(6 * (2 ^ 1/2))", f)
+endtest() \ No newline at end of file