FTRUNCATE return the wrong zero with a certain THE argument
Bug #1732009 reported by
Paul F. Dietz
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
(defun f17a (x)
(ftruncate 0 x))
(defun f17b (x)
(ftruncate 0 (the (member 1.0d0 -10.0d0) x)))
(defun f17c (x)
(ftruncate 0 (the double-float x)))
(defun f17d (x)
(declare (type (member 1.0d -10.0d0) x))
(ftruncate 0 x))
(f17a -10.0d0) ==> -0.0d0, 0.0d0
(f17b -10.0d0) ==> 0.0d0, 0.0d0 ;; not the same as the others
(f17c -10.0d0) ==> -0.0d0, 0.0d0
(f17d -10.0d0) ==> -0.0d0, 0.0d0
Changed in sbcl: | |
status: | New → Triaged |
importance: | Undecided → Medium |
assignee: | nobody → Stas Boukarev (stassats) |
Changed in sbcl: | |
assignee: | Stas Boukarev (stassats) → nobody |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
It may be this is not actually a bug, since (= 0.0 -0.0) is true. Floating point operations can return slightly different values when inlined anyway.