diff options
Diffstat (limited to 'macros/luatex/latex/luacas/tex/test/rings/modulararithmetic.lua')
-rw-r--r-- | macros/luatex/latex/luacas/tex/test/rings/modulararithmetic.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/macros/luatex/latex/luacas/tex/test/rings/modulararithmetic.lua b/macros/luatex/latex/luacas/tex/test/rings/modulararithmetic.lua new file mode 100644 index 0000000000..1bd315595a --- /dev/null +++ b/macros/luatex/latex/luacas/tex/test/rings/modulararithmetic.lua @@ -0,0 +1,20 @@ +local a = IntegerModN(Integer(5), Integer(3)) +local b = IntegerModN(Integer(1), Integer(3)) +local c = IntegerModN(Integer(-12), Integer(3)) +local f = IntegerModN(Integer(100), Integer(62501)) +local d = IntegerModN(Integer(16), Integer(36)) +local e = IntegerModN(Integer(27), Integer(36)) + +starttest("modular arithmetic") +testeq(a, "2") +testeq(b, "1") +testeq(c, "0") +testeq(a + b, "0") +testeq(a - b, "1") +testeq(a * b, "2") +testeq(a:inv(), "2") +testeq(b:inv(), "1") +testeq(f:inv(), "61876") +testeq(d * e, "0") +testeq(a * d, "2") +endtest()
\ No newline at end of file |