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)))