diff --git a/ansi-tests/notes.lsp b/ansi-tests/notes.lsp index 5f24241c7f9ff5199750665b396217025b7aced8..9dfa70c3199f4d66c1fd229419d2e37a177a6260 100644 --- a/ansi-tests/notes.lsp +++ b/ansi-tests/notes.lsp @@ -31,3 +31,5 @@ #+sbcl (rt::disable-note :open-if-exists-new-version-no-error) +(defnote :negative-zero-is-similar-to-positive-zero + "The definition of similarity implies that -0.0 and 0.0 are similar (for each float type.) If negative zeros are distinct this is probably not good, since it makes (defconstant x 0.0) be nonportable.") diff --git a/ansi-tests/sxhash.lsp b/ansi-tests/sxhash.lsp index e2198d27bd64f0dbf8da6ff177699479fa804528..17ed505b695f69cb8d3212e21353ecb2dc2b8cfb 100644 --- a/ansi-tests/sxhash.lsp +++ b/ansi-tests/sxhash.lsp @@ -152,8 +152,10 @@ ;;; Since similarity of numbers is 'same type and same mathematical value', ;;; and since sxhash must produce the same value for similar numeric arguments, ;;; (sxhash 0.0) and (sxhash -0.0) must be eql for all float types. +;;; This may be a spec bug, so I've added a note. (deftest sxhash.17 + :notes (:negative-zero-is-similar-to-positive-zero) (loop for c1 in '(0.0s0 0.0f0 0.0d0 0.0l0) for c2 in '(-0.0s0 -0.0f0 -0.0d0 -0.0l0) for t1 = (type-of c1) @@ -167,6 +169,7 @@ nil) (deftest sxhash.18 + :notes (:negative-zero-is-similar-to-positive-zero) (loop for r1 in '(0.0s0 0.0f0 0.0d0 0.0l0) for c1 = (complex r1) for r2 in '(-0.0s0 -0.0f0 -0.0d0 -0.0l0) @@ -182,6 +185,7 @@ nil) (deftest sxhash.19 + :notes (:negative-zero-is-similar-to-positive-zero) (loop for r1 in '(0.0s0 0.0f0 0.0d0 0.0l0) for c1 = (complex 0 r1) for r2 in '(-0.0s0 -0.0f0 -0.0d0 -0.0l0)