See http://dev.clojure.org/jira/browse/CLJ-738 for clarity on this issue.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient
On Tue, Nov 1, 2011 at 21:00, Michael wrote:
>
>
> On Nov 1, 12:14 pm, Ben Smith-Mannschott
> wrote:
>> 3. Define that min and max will ignore any NaN arguments.
>
> What is:
>
> (min NaN NaN)
>
> in this situation; ()?
The part of the message you didn't quote implies that it would behave
as (m
On Nov 1, 12:14 pm, Ben Smith-Mannschott
wrote:
> 3. Define that min and max will ignore any NaN arguments.
What is:
(min NaN NaN)
in this situation; ()?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to cloju
On Tue, Nov 1, 2011 at 12:14 PM, Ben Smith-Mannschott wrote:
>
> 2 Make NaN contagious
> -
>
> Define min and max to return NaN if and only if at least one of their
> arguments is NaN. This seems most in keeping with the (admittedly
> perverse) behavior of NaN as specified.
>
I've opened http://dev.clojure.org/jira/browse/CLJ-868
"The min and max functions in clojure.core behave unpredictably when
one or more of their arguments is Float/NaN or Double/NaN. This is
because the current implementation assumes that > provides a total
ordering, but this is not the case when
On Oct 30, 4:02 am, bOR_ wrote:
> Hi all,
>
> Ran into something unexpected with "max".
>
> user> (sd-age-female 13)
>
> [10 NaN 0.746555245613119]
>
> user> (apply max (sd-age-female 13))
Why does Clojure have it's own naive implementation of max for doubles
instead of using max from java.lang.Math which has necessary checks for
NaN and the positive and negative zeros?
On Sun, 30 Oct 2011 15:36:23 +0100
Ben Smith-Mannschott wrote:
> On Sun, Oct 30, 2011 at 10:02, bOR_ wrote:
> >
On Sun, Oct 30, 2011 at 10:02, bOR_ wrote:
> Hi all,
> Ran into something unexpected with "max".
> user> (sd-age-female 13)
>
>
> [10 NaN 0.746555245613119]
>
>
> user> (apply max (sd-age-female 13))
>
> 0.746555245613119
TL;DR: Don't expect sensible answers when NaN is involved.
The implementat