double>ratio ( double -- a/b )


Vocabulary
math.floating-point

Definition
USING: kernel math math.functions ;

IN: math.floating-point

: double>ratio ( double -- a/b )
check-special double>bits
[ (double-sign) zero? 1 -1 ? ]
[ (double-mantissa-bits) 52 2^ / ]
[ (double-exponent-bits) ] tri
[ 1 ] [ [ 1 + ] dip ] if-zero 1023 - 2 swap ^ * * ;