From 267ab0aa4d1e1e9561ac42fa3b8684207a204f7b Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 29 Nov 2008 12:21:26 -0600 Subject: [PATCH] Implement /i on floats --- core/math/floats/floats-tests.factor | 2 ++ core/math/floats/floats.factor | 1 + 2 files changed, 3 insertions(+) diff --git a/core/math/floats/floats-tests.factor b/core/math/floats/floats-tests.factor index bd3f951b02..dbdd5b27fe 100644 --- a/core/math/floats/floats-tests.factor +++ b/core/math/floats/floats-tests.factor @@ -60,3 +60,5 @@ unit-test [ 0 ] [ 1/0. >bignum ] unit-test [ t ] [ 64 [ 2^ 0.5 * ] map [ < ] monotonic? ] unit-test + +[ 5 ] [ 10.5 1.9 /i ] unit-test diff --git a/core/math/floats/floats.factor b/core/math/floats/floats.factor index 9dcff9eb90..2a22dc4330 100644 --- a/core/math/floats/floats.factor +++ b/core/math/floats/floats.factor @@ -24,6 +24,7 @@ M: float - float- ; M: float * float* ; M: float / float/f ; M: float /f float/f ; +M: float /i float/f >integer ; M: float mod float-mod ; M: real abs dup 0 < [ neg ] when ;