mirror of
https://github.com/urbit/ares.git
synced 2024-11-23 00:25:49 +03:00
hoon: add +pow
This commit is contained in:
parent
a242f9d34d
commit
b18aa95de9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user