From: Taylor R Campbell Date: Sun, 18 Nov 2018 03:10:04 +0000 (+0000) Subject: Test equality and ordering of various things with NaN. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~44 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=4ab78027dd8236d720324e2e1d7917a3309a0a3b;p=mit-scheme.git Test equality and ordering of various things with NaN. Alas, <= and >= are broken. --- diff --git a/tests/runtime/test-arith.scm b/tests/runtime/test-arith.scm index 6fc78c05d..007001684 100644 --- a/tests/runtime/test-arith.scm +++ b/tests/runtime/test-arith.scm @@ -129,6 +129,20 @@ USA. (vector (flo:-inf.0) -2. -1 -0. 0 +0. +1 +2. (flo:+inf.0)) (lambda (v) (assert-nan (/ v (flo:nan.0))))) +(define-enumerated-test 'nan-order + (vector 0 0. -0. 1 1. -1 -1. (flo:-inf.0) (flo:+inf.0) (flo:nan.0)) + (lambda (x) + (assert-false (= x (flo:nan.0))) + (assert-false (< x (flo:nan.0))) + (expect-failure (lambda () (assert-false (>= x (flo:nan.0))))) + (assert-false (> x (flo:nan.0))) + (expect-failure (lambda () (assert-false (<= x (flo:nan.0))))) + (assert-false (= (flo:nan.0) x)) + (assert-false (< (flo:nan.0) x)) + (expect-failure (lambda () (assert-false (>= (flo:nan.0) x)))) + (assert-false (> (flo:nan.0) x)) + (expect-failure (lambda () (assert-false (<= (flo:nan.0) x)))))) + (define-enumerated-test 'inf*0-exact (vector (list 0 (flo:+inf.0)) (list 0 (flo:-inf.0))