]> gitweb.factorcode.org Git - factor.git/commitdiff
math.functions: rename 'bignum-log-helper'.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 22 Sep 2011 19:38:33 +0000 (12:38 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 22 Sep 2011 19:38:33 +0000 (12:38 -0700)
basis/math/functions/functions.factor

index b33e40862df3fe6e0f2d53fc7e0205d38296790a..5b9cdcdd6756e0e73684bfc209cb9bc50c463c02 100644 (file)
@@ -191,18 +191,18 @@ M: complex log >polar [ flog ] dip rect> ; inline
 CONSTANT: most-negative-finite-float $[ -1/0. next-float >integer ]
 CONSTANT: most-positive-finite-float $[ 1/0. prev-float >integer ]
 
-MACRO: bignum-loghelper ( quot: ( x -- y ) -- quot )
-    dup 2 over call( x -- y ) '[
+MACRO: bignum-log ( quot: ( x -- y ) -- quot )
+    dup dup '[
         dup
         most-negative-finite-float
         most-positive-finite-float
         between?
-        [ >float @ ] [ frexp [ @ ] [ _ * ] bi* + ] if
+        [ >float @ ] [ frexp [ @ ] [ 2 @ * ] bi* + ] if
     ] ;
 
 PRIVATE>
 
-M: bignum log [ log ] bignum-loghelper ;
+M: bignum log [ log ] bignum-log ;
 
 GENERIC: log1+ ( x -- y )
 
@@ -218,7 +218,7 @@ M: real log10 >float flog10 ; inline
 
 M: complex log10 log 10 log / ; inline
 
-M: bignum log10 [ log10 ] bignum-loghelper ;
+M: bignum log10 [ log10 ] bignum-log ;
 
 GENERIC: cos ( x -- y ) foldable