X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=blobdiff_plain;f=basis%2Fmath%2Ffunctions%2Ffunctions.factor;h=f1e68c9f86efd6ddc00aac19d8bd8f1898725900;hp=94bee1ade689c71358fc2c88e44c4a5b1510a467;hb=943596575ad294c074dfa381b70af74dba5992b1;hpb=e738c7206c32bd9b76f3cee31e950835e1b1ee24 diff --git a/basis/math/functions/functions.factor b/basis/math/functions/functions.factor index 94bee1ade6..f1e68c9f86 100644 --- a/basis/math/functions/functions.factor +++ b/basis/math/functions/functions.factor @@ -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 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