]> gitweb.factorcode.org Git - factor.git/commitdiff
math.parser: simplify store-exponent.
authorJohn Benediktsson <mrjbq7@gmail.com>
Sat, 29 Nov 2014 22:31:23 +0000 (14:31 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sat, 29 Nov 2014 22:31:23 +0000 (14:31 -0800)
core/math/parser/parser.factor

index 425d393c26987b516b9b85538ad5aee62f965b7c..da157e9386d277560116fe0fafa24e10aa6b6063 100644 (file)
@@ -52,7 +52,7 @@ TUPLE: float-parse
     [ radix>> ] [ point>> 1 + ] [ exponent>> ] tri float-parse boa ; inline
 
 : store-exponent ( float-parse n expt -- float-parse' n )
-    swap [ [ drop radix>> ] [ drop point>> ] [ nip ] 2tri float-parse boa ] dip ; inline
+    swap [ [ radix>> ] [ point>> ] bi ] 2dip [ float-parse boa ] dip ; inline
 
 : ?store-exponent ( float-parse n expt/f -- float-parse' n/f )
     [ store-exponent ] [ drop f ] if* ; inline
@@ -76,9 +76,7 @@ TUPLE: float-parse
 
 : ?default-exponent ( float-parse n/f -- float-parse' n/f' )
     over exponent>> [
-        over radix>> 10 =
-        [ [ [ radix>> ] [ point>> ] bi 0 float-parse boa ] dip ]
-        [ drop f ] if
+        over radix>> 10 = [ 0 store-exponent ] [ drop f ] if
     ] unless ; inline
 
 : ?make-float ( float-parse n/f -- float/f )