diff --git a/libmath/desk/lib/math.hoon b/libmath/desk/lib/math.hoon index ab00564..e581eeb 100644 --- a/libmath/desk/lib/math.hoon +++ b/libmath/desk/lib/math.hoon @@ -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 :: diff --git a/saloon/desk/lib/saloon.hoon b/saloon/desk/lib/saloon.hoon index 9a60f8e..bc75808 100644 --- a/saloon/desk/lib/saloon.hoon +++ b/saloon/desk/lib/saloon.hoon @@ -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