Expose pow/pow-n in Saloon.

This commit is contained in:
Sigilante 2024-05-16 15:37:17 -05:00
parent db658ffda8
commit 1914392d71
2 changed files with 10 additions and 10 deletions

View File

@ -665,8 +665,8 @@
:: Source
++ pow
|= [x=@rs n=@rs] ^- @rs
:: fall through on integers (faster)
?: =(n (san (need (toi n)))) (pow-n x (san (need (toi n))))
:: fall through on positive integers (faster)
?: &(=(n (san (need (toi n)))) (gth n .0)) (pow-n x (san (need (toi n))))
(exp (mul n (log x)))
:: +sqrt: @rs -> @rs
::
@ -1446,8 +1446,8 @@
:: Source
++ pow
|= [x=@rd n=@rd] ^- @rd
:: fall through on integers (faster)
?: =(n (san (need (toi n)))) (pow-n x (san (need (toi n))))
:: fall through on positive integers (faster)
?: &(=(n (san (need (toi n)))) (gth n .~0)) (pow-n x (san (need (toi n))))
(exp (mul n (log x)))
:: +sqrt: @rd -> @rd
::
@ -2209,8 +2209,8 @@
:: Source
++ pow
|= [x=@rh n=@rh] ^- @rh
:: fall through on integers (faster)
?: =(n (san (need (toi n)))) (pow-n x (san (need (toi n))))
:: fall through on positive integers (faster)
?: &(=(n (san (need (toi n)))) (gth n .~~0)) (pow-n x (san (need (toi n))))
(exp (mul n (log x)))
:: +sqrt: @rh -> @rh
::
@ -2907,8 +2907,8 @@
:: Source
++ pow
|= [x=@rq n=@rq] ^- @rq
:: fall through on integers (faster)
?: =(n (san (need (toi n)))) (pow-n x (san (need (toi n))))
:: fall through on positive integers (faster)
?: &(=(n (san (need (toi n)))) (gth n .~~~0)) (pow-n x (san (need (toi n))))
(exp (mul n (log x)))
:: +sqrt: @rq -> @rq
::

View File

@ -239,7 +239,7 @@
++ pow-n
|= [a=ray:ls b=ray:ls]
^- ray
!! ::(bin-op:la a b (fun-scalar meta.a %pow-n))
(bin-op:la a b (fun-scalar meta.a %pow-n))
:: +log: $ray -> $ray
::
:: Returns the natural logarithm of each entry in a floating-point ray
@ -271,7 +271,7 @@
++ pow
|= [a=ray:ls b=ray:ls]
^- ray
!! ::(bin-op:la a b (fun-scalar meta.a %pow))
(bin-op:la a b (fun-scalar meta.a %pow))
:: +sqrt: $ray -> $ray
::
:: Returns the square root of each entry in a floating-point ray