We're updating the issue view to help you get more done. 

Some ways of comparing equality between NaN and 'itself' return true

Description

Most ways of checking = of ##NaN to another ##NaN object/primitive return false, which while surprising to many people when they first encounter the behavior, is actually a somewhat reasonable thing to do according to the IEEE 754 specification. In most cases Clojure does this, e.g.:

1 2 (= ##NaN ##NaN) ;; => false

While most Clojure expressions satisfy the proposed property below, there are a few variations that return results that violate it:

Property 1: Calls to Clojure `=` or `==` involving at least one NaN
return false, whether the call is inlined or not. Calls to Clojure
`not=` involving at least one NaN return true.

Examples of expressions that violate it:

1 2 3 4 5 6 x=> (not= ##NaN ##NaN) false x=> (#'= ##NaN ##NaN) true x=> (apply not= ##NaN ##NaN []) false

Environment

None

Status

Assignee

Unassigned

Reporter

Andy Fingerhut

Labels

Approval

Triaged

Patch

None

Affects versions

Release 1.10

Priority

Minor