 DEFER: @pos-digit
 DEFER: @neg-digit
 
-: @exponent-digit-or-punc ( float-parse i number-parse n char -- float-parse number/f )
+: @exponent-digit-or-punc ( float-parse i number-parse n char -- float-parse n/f )
     {
         { CHAR: , [ [ @exponent-digit ] require-next-digit ] }
         [ @exponent-digit ]
-    } case ; inline recursive
-
-: @exponent-digit ( float-parse i number-parse n char -- float-parse number/f )
-    digit-in-radix [ [ @exponent-digit-or-punc ] add-digit ] [ @abort ] if ; inline recursive
-
-: @exponent-first-char ( float-parse i number-parse n char -- float-parse number/f )
+    } case ; inline
+
+: @exponent-digit ( float-parse i number-parse n char -- float-parse n/f )
+    { float-parse fixnum number-parse integer fixnum } declare
+    digit-in-radix [ [ @exponent-digit-or-punc ] add-digit ] [ @abort ] if ;
+
+: @exponent-first-char ( float-parse i number-parse n char -- float-parse n/f )
     {
         { CHAR: - [ [ @exponent-digit ] require-next-digit ?neg ] }
         [ @exponent-digit ]
-    } case ; inline recursive
-
-: ->exponent ( float-parse i number-parse n -- float-parse' number/f )
+    } case ; inline
+
+: ->exponent ( float-parse i number-parse n -- float-parse' n/f )
     @split-exponent [ @exponent-first-char ] require-next-digit ?store-exponent ; inline
 
 : exponent-char? ( number-parse n char -- number-parse n char ? )

! (c)2009 Joe Groff bsd license
USING: accessors combinators kernel math
namespaces sequences sequences.private splitting strings make ;
IN: math.parser



: ((pow)) ( base x -- base^x )
    iota 1 rot [ nip * ] curry reduce ; inline

: (pow) ( base x -- base^x )
    dup 0 >= [ ((pow)) ] [ [ recip ] [ neg ] bi* ((pow)) ] if ; inline

: add-mantissa-digit ( float-parse i number-parse n digit quot -- float-parse' n/f )
    [ [ inc-point ] 4dip ] dip add-digit ; inline

: make-float-dec-exponent ( float-parse n/f -- float/f )
