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

<= is incorrect when args include Double/NaN

Description

1 2 3 4 user=> (<= Double/NaN 1) false user=> (<= (double Double/NaN) 1) true ;; should match Double object result

Cause: The problem was that the logic for lte/gte depended on the fact that lte is equivalent to !gt.
However, in Java, this assumption is invalid - any comparison involving NaN always yields false.

Solution: The fix was to adding lte and gte methods to Numbers.Ops directly, rather than implementing everything in terms of lt. This was the only fix I could see that didn't incur the cost of runtime checks for NaN.

Patch: clj-738-v2.diff

Screened by: Alex Miller

Environment

Mac OS X, Java 6

Status

Assignee

Unassigned

Reporter

Jason Wolfe

Labels

Approval

Ok

Patch

Code and Test

Fix versions

Affects versions

Release 1.6

Priority

Trivial