[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sanity check: <=, >=
R3RS says that (<= x y) is #t if x and y are "monotonically nondecreasing"
and that (>= x y) is #t if x and y are "monotonically nonincreasing". I
interpret this to mean that (<= x y) is equivalent to (not (> x y)), and
that the following transcript shows correct behavior with respect to the
unordered case in IEEE standard floating point arithmetic. Comments?
>>> (define x (expt 10.0 500.0))
x
>>> x
#<INFINITY>
>>> (define y (- x x))
y
>>> y
#<NOT A NUMBER>
>>> (< 3 y)
#f
>>> (= 3 y)
#f
>>> (> 3 y)
#f
>>> (<= 3 y)
#t
>>> (>= 3 y)
#t