From e083e173e8d17482c475e64cc4297fbef3bb5931 Mon Sep 17 00:00:00 2001 From: Erik Osheim Date: Fri, 12 Apr 2024 16:08:51 -0400 Subject: [PATCH] pow --- demo.modal | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/demo.modal b/demo.modal index 79c033b..3e4a574 100644 --- a/demo.modal +++ b/demo.modal @@ -196,4 +196,11 @@ <> ((mod ?x ?y)) ((mod1 (divmod ?x ?y))) <> ((mod1 (?q ?r))) (?r) -(bstr (mul (int 123456789) (int 987654321))) +-- ( expontentiation ) +<> ((pow ?x ())) ((1 ())) +<> ((pow ?x (0 ()))) ((1 ())) +<> ((pow ?x (1 ()))) (?x) +<> ((pow ?x (0 ?k))) ((pow (mul ?x ?x) ?k)) +<> ((pow ?x (1 ?k))) ((mul ?x (pow (mul ?x ?x) ?k))) + +(str (pow (int 13) (int 10)))