2007-09-20 18:09:08 -04:00
|
|
|
! Copyright (C) 2004, 2006 Slava Pestov.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2007-10-14 20:38:23 -04:00
|
|
|
USING: kernel math math.private ;
|
2007-09-20 18:09:08 -04:00
|
|
|
IN: math.floats.private
|
|
|
|
|
|
|
|
M: fixnum >float fixnum>float ;
|
|
|
|
M: bignum >float bignum>float ;
|
|
|
|
|
|
|
|
M: float >fixnum float>fixnum ;
|
|
|
|
M: float >bignum float>bignum ;
|
|
|
|
M: float >float ;
|
|
|
|
|
2008-09-02 03:02:05 -04:00
|
|
|
M: float hashcode* nip float>bits ;
|
|
|
|
M: float equal? over float? [ float= ] [ 2drop f ] if ;
|
|
|
|
M: float number= float= ;
|
|
|
|
|
2007-09-20 18:09:08 -04:00
|
|
|
M: float < float< ;
|
|
|
|
M: float <= float<= ;
|
|
|
|
M: float > float> ;
|
|
|
|
M: float >= float>= ;
|
|
|
|
|
|
|
|
M: float + float+ ;
|
|
|
|
M: float - float- ;
|
|
|
|
M: float * float* ;
|
|
|
|
M: float / float/f ;
|
2008-04-28 22:26:31 -04:00
|
|
|
M: float /f float/f ;
|
2008-11-29 13:21:26 -05:00
|
|
|
M: float /i float/f >integer ;
|
2007-09-20 18:09:08 -04:00
|
|
|
M: float mod float-mod ;
|
2008-04-28 22:26:31 -04:00
|
|
|
|
|
|
|
M: real abs dup 0 < [ neg ] when ;
|