 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 )

    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


! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
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 } ;

C: <decimal> decimal

: >decimal< ( decimal -- mantissa exponent )
    [ mantissa>> ] [ exponent>> ] bi ; inline
