 ! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors combinators.short-circuit kernel lexer math
-math.functions math.parser parser sequences splitting
-locals math.order ;
+USING: accessors combinators.short-circuit kernel lexer locals
+math math.functions math.order math.parser sequences splitting ;
 IN: decimals
 
 TUPLE: decimal { mantissa read-only } { exponent read-only } ;
 
-: <decimal> ( mantissa exponent -- decimal ) decimal boa ;
+C: <decimal> decimal
 
 : >decimal< ( decimal -- mantissa exponent )
     [ mantissa>> ] [ exponent>> ] bi ; inline

    guard-decimals [ >decimal< ] bi@ swapd + [ * ] dip <decimal> ;

:: D/ ( D1 D2 a -- D3 )
    D1 D2 guard-decimals 2drop
    D1 >decimal< :> ( m1 e1 )
    D2 >decimal< :> ( m2 e2 )
    m1 a 10^ *
    m2 /i


SYNTAX: DECIMAL: parse-decimal suffix! ;

: decimal>ratio ( decimal -- ratio ) >decimal< 10^ * ;

: decimal>float ( decimal -- ratio ) decimal>ratio >float ;

: scale-mantissas ( D1 D2 -- m1 m2 exp )
