]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/math/functions/functions.factor
use radix literals
[factor.git] / basis / math / functions / functions.factor
index 94bee1ade689c71358fc2c88e44c4a5b1510a467..f1e68c9f86efd6ddc00aac19d8bd8f1898725900 100644 (file)
@@ -160,14 +160,14 @@ GENERIC: frexp ( x -- y exp )
 M: float frexp
     dup fp-special? [ dup zero? ] unless* [ 0 ] [
         double>bits
-        [ HEX: 800f,ffff,ffff,ffff bitand 0.5 double>bits bitor bits>double ]
-        [ -52 shift HEX: 7ff bitand 1022 - ] bi
+        [ 0x800f,ffff,ffff,ffff bitand 0.5 double>bits bitor bits>double ]
+        [ -52 shift 0x7ff bitand 1022 - ] bi
     ] if ; inline
 
 M: integer frexp
     [ 0.0 0 ] [
         dup 0 > [ 1 ] [ abs -1 ] if swap dup log2 [
-            52 swap - shift HEX: 000f,ffff,ffff,ffff bitand
+            52 swap - shift 0x000f,ffff,ffff,ffff bitand
             0.5 double>bits bitor bits>double
         ] [ 1 + ] bi [ * ] dip
     ] if-zero ; inline
@@ -183,11 +183,11 @@ M: complex log >polar [ flog ] dip rect> ; inline
 <PRIVATE
 
 : most-negative-finite-float ( -- x )
-    HEX: -1.ffff,ffff,ffff,fp1023 >integer ; inline
+    -0x1.ffff,ffff,ffff,fp1023 >integer ; inline
 : most-positive-finite-float ( -- x )
-    HEX:  1.ffff,ffff,ffff,fp1023 >integer ; inline
-CONSTANT: log-2   HEX: 1.62e42fefa39efp-1
-CONSTANT: log10-2 HEX: 1.34413509f79ffp-2
+    0x1.ffff,ffff,ffff,fp1023 >integer ; inline
+CONSTANT: log-2   0x1.62e42fefa39efp-1
+CONSTANT: log10-2 0x1.34413509f79ffp-2
 
 : (representable-as-float?) ( x -- ? )
     most-negative-finite-float