mirror of
https://github.com/urbit/numerics.git
synced 2024-10-03 23:18:03 +03:00
Expose pow/pow-n in Saloon.
This commit is contained in:
parent
db658ffda8
commit
1914392d71
@ -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
|
||||
::
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user