2005-02-08 22:02:44 -05:00
|
|
|
! Copyright (C) 2004, 2005 Slava Pestov.
|
|
|
|
! See http://factor.sf.net/license.txt for BSD license.
|
2005-02-20 19:03:37 -05:00
|
|
|
IN: math
|
|
|
|
USING: generic kernel math-internals ;
|
|
|
|
|
|
|
|
UNION: real rational float ;
|
|
|
|
|
2005-09-16 22:47:28 -04:00
|
|
|
M: real abs dup 0 < [ neg ] when ;
|
|
|
|
M: real absq sq ;
|
2005-02-20 19:03:37 -05:00
|
|
|
|
|
|
|
M: real hashcode ( n -- n ) >fixnum ;
|
2006-01-10 23:44:17 -05:00
|
|
|
M: real <=> - ;
|
2004-12-18 23:18:32 -05:00
|
|
|
|
2006-01-26 23:01:14 -05:00
|
|
|
M: float number= [ double>bits ] 2apply = ;
|
2004-12-18 23:18:32 -05: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 ;
|
|
|
|
M: float /f float/f ;
|
2006-01-26 23:01:14 -05:00
|
|
|
M: float mod float-mod ;
|
2005-09-16 22:47:28 -04:00
|
|
|
|
|
|
|
M: float 1+ 1.0 float+ ;
|
|
|
|
M: float 1- 1.0 float- ;
|