summaryrefslogtreecommitdiff
path: root/src/test-mp-equation.c
diff options
context:
space:
mode:
authormbkma <[email protected]>2020-04-08 01:11:48 +0200
committerGitHub <[email protected]>2020-04-08 01:11:48 +0200
commit8bdf0d013359d295e7b26b46d553c9525d7ed0cb (patch)
tree96235fd9d2df5736553ecc884a9f1b0050ae2365 /src/test-mp-equation.c
parent2e5b3891e485237a7860a84b141a770b0a867ea1 (diff)
downloadmate-calc-8bdf0d013359d295e7b26b46d553c9525d7ed0cb.tar.bz2
mate-calc-8bdf0d013359d295e7b26b46d553c9525d7ed0cb.tar.xz
Add modular exponentiation ability and add acccording tests
Diffstat (limited to 'src/test-mp-equation.c')
-rw-r--r--src/test-mp-equation.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test-mp-equation.c b/src/test-mp-equation.c
index c1c136a..c6ab98c 100644
--- a/src/test-mp-equation.c
+++ b/src/test-mp-equation.c
@@ -482,6 +482,11 @@ test_equations(void)
test("8 mod 7", "1", 0);
test("−1 mod 7", "6", 0);
+ test("123^456 mod 78", "27", 0);
+ test("2^2 mod 2", "0", 0);
+ test("1^0 mod 2", "1", 0);
+ test("2^1 mod 1", "0", 0);
+
test("sgn 0", "0", 0);
test("sgn 3", "1", 0);
test("sgn −3", "−1", 0);