On Oct 30, 4:02 am, bOR_ <boris.sch...@gmail.com> 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                                                          
>
> user>        
>
> I don't know what the mathematically correct way would be of max in
> response to a NaN, but I am surprised that it picks 0.746 above 10 when
> there's a NaN inbetween there.
As a work around, you can use max-key with an appropriately written
key function that returns negative infinity for NaN (if that is the
behavior you want).

-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to