: fixnum-min ( x y -- z ) [ fixnum< ] most ; foldable
: fixnum-max ( x y -- z ) [ fixnum> ] most ; foldable
-M: integer neg? 0 < ; inline
-
M: integer numerator ; inline
M: integer denominator drop 1 ; inline
[ f ] [ -1/0. 0/0. >= ] unit-test
[ f ] [ 1/0. 0/0. >= ] unit-test
-
+[ f ] [ 0 neg? ] unit-test
+[ f ] [ 1/2 neg? ] unit-test
+[ f ] [ 1 neg? ] unit-test
+[ t ] [ -1/2 neg? ] unit-test
+[ t ] [ -1 neg? ] unit-test
+
+[ f ] [ 0.0 neg? ] unit-test
+[ f ] [ 1.0 neg? ] unit-test
+[ f ] [ 1/0. neg? ] unit-test
+[ t ] [ -0.0 neg? ] unit-test
+[ t ] [ -1.0 neg? ] unit-test
+[ t ] [ -1/0. neg? ] unit-test
UNION: rational integer ratio ;
+M: rational neg? 0 < ; inline
+
UNION: real rational float ;
TUPLE: complex { real real read-only } { imaginary real read-only } ;