From 2da1b601755105a6b16661e4d2eea681e9b63a0d Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Wed, 28 Nov 2018 05:18:21 +0000 Subject: [PATCH] Add flo:<>, as (or flo:< flo:>) for now. --- src/runtime/primitive-arithmetic.scm | 1 + src/runtime/runtime.pkg | 1 + tests/runtime/test-flonum.scm | 7 ------- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/runtime/primitive-arithmetic.scm b/src/runtime/primitive-arithmetic.scm index 6d27646f0..d1ab3c8ce 100644 --- a/src/runtime/primitive-arithmetic.scm +++ b/src/runtime/primitive-arithmetic.scm @@ -228,6 +228,7 @@ USA. (define (flo:<= x y) (or (flo:< x y) (flo:= x y))) (define (flo:>= x y) (or (flo:> x y) (flo:= x y))) +(define (flo:<> x y) (or (flo:< x y) (flo:> x y))) (define (flo:min x y) (cond ((flo:< x y) x) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 3eef506f6..c73ba2b1c 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -292,6 +292,7 @@ USA. flo:/ flo:< flo:<= + flo:<> flo:= flo:> flo:>= diff --git a/tests/runtime/test-flonum.scm b/tests/runtime/test-flonum.scm index f4b3df766..ef380e254 100644 --- a/tests/runtime/test-flonum.scm +++ b/tests/runtime/test-flonum.scm @@ -48,13 +48,6 @@ USA. ;; XXX Temporary workaround for my setup. (no-traps f)) -(define (flo:<> x y) ;XXX - (if (or (flo:nan? x) (flo:nan? y)) - (begin - (flo:raise-exceptions! (flo:exception:invalid-operation)) - #f) - (not (flo:= x y)))) - (define subnormal+ flo:smallest-positive-subnormal) (define subnormal- (no-traps (lambda () (- subnormal+)))) -- 2.25.1