Raymond Toy pushed to branch issue-156-take-2-nan-comparison at cmucl / cmucl
Commits: bd505bab by Raymond Toy at 2023-03-08T07:56:11-08:00 Use existing function to compute >= and <=
The code assumed if a0 >= b0 and a1 >= b1 implied a >= b for a bigfloat. But I forgot that 1.99999...w0 is represented as 2d0 and a tiny negative number. So `(<= 2w0 1.99999...w0)` would return false because, while a0 <= b0, a1 <= b1 is false.
So for simplicity just use the obvious replacement that a <= b is the same as a < b or a = b, which we already have.
[skip ci]
- - - - -
1 changed file:
- src/compiler/float-tran-dd.lisp
Changes:
===================================== src/compiler/float-tran-dd.lisp ===================================== @@ -670,13 +670,13 @@
(declaim (inline dd<=)) (defun dd<= (a0 a1 b0 b1) - (and (<= a0 b0) - (<= a1 b1))) + (or (dd> a0 a1 b0 b1) + (dd= a0 a1 b0 b1)))
(declaim (inline dd>=)) (defun dd>= (a0 a1 b0 b1) - (and (>= a0 b0) - (>= a1 b1))) + (or (dd> a0 a1 b0 b1) + (dd= a0 a1 b0 b1)))
(deftransform = ((a b) (vm::double-double-float vm::double-double-float) *) `(dd= (kernel:double-double-hi a)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/bd505bab9b50e50016cea7c1...