diff --git a/basis/hints/hints.factor b/basis/hints/hints.factor index 496c651fde..738a960b4b 100644 --- a/basis/hints/hints.factor +++ b/basis/hints/hints.factor @@ -3,8 +3,9 @@ USING: accessors arrays assocs byte-arrays byte-vectors classes combinators definitions effects fry generic generic.single generic.standard hashtables io.binary io.streams.string kernel -kernel.private math math.parser namespaces parser sbufs -sequences splitting splitting.private strings vectors words ; +kernel.private math math.parser math.parser.private namespaces +parser sbufs sequences splitting splitting.private strings +vectors words ; IN: hints GENERIC: specializer-predicate ( spec -- quot ) @@ -133,3 +134,10 @@ SYNTAX: HINTS: M\ hashtable at* { { fixnum object } { word object } } "specializer" set-word-prop M\ hashtable set-at { { object fixnum object } { object word object } } "specializer" set-word-prop + +\ dec>float { string } "specializer" set-word-prop + +\ hex>float { string } "specializer" set-word-prop + +\ string>integer { string fixnum } "specializer" set-word-prop + diff --git a/core/math/parser/parser.factor b/core/math/parser/parser.factor index 60fb5559c5..9bf1e6a896 100644 --- a/core/math/parser/parser.factor +++ b/core/math/parser/parser.factor @@ -66,10 +66,10 @@ SYMBOL: negative? 0 over push B{ } like (string>float) ; : hex>float-parts ( str -- neg? mantissa-str expt ) - "-" ?head swap "p" split1 [ 10 base> ] [ 0 ] if* ; + "-" ?head swap "p" split1 [ 10 base> ] [ 0 ] if* ; inline : make-mantissa ( str -- bits ) - 16 base> dup log2 52 swap - shift ; + 16 base> dup log2 52 swap - shift ; inline : combine-hex-float-parts ( neg? mantissa expt -- float ) dup 2046 > [ 2drop -1/0. 1/0. ? ] [ @@ -78,7 +78,7 @@ SYMBOL: negative? [ 52 2^ 1 - bitand ] [ 52 shift ] tri* bitor bitor bits>double - ] if ; + ] if ; inline : hex>float ( str -- n/f ) hex>float-parts