hoon: add +pow

This commit is contained in:
Alex Shelkovnykov 2023-09-05 13:30:49 -06:00
parent a242f9d34d
commit b18aa95de9

View File

@ -593,6 +593,17 @@
(dor a b)
(lth c d)
::
:: Unsigned powers
::
++ pow :: unsigned exponent
~/ %pow
|= [a=@ b=@]
?: =(b 0) 1
|- ?: =(b 1) a
=+ c=$(b (div b 2))
=+ d=(mul c c)
?~ (dis b 1) d (mul d a)
::
:: Set logic
::
++ in