From: Charles R H. <cha...@gm...> - 2006-11-12 00:09:45
|
On 11/11/06, Tim Hochberg <tim...@ie...> wrote: > > Robert Kern wrote: <snip> My preference would be to raise an error / warning when there is a nan > in the array. Technically, there is no minimum value when a nan is > present. I believe that this would be feasible be swapping the compare > from 'a < b' to '!(a >= b)'. This should return NaN if any NaNs are > present and I suspect the extra '!' will have minimal performance impact > but it would have to be tested. Then a warning or error could be issued > on the way out depending on the erstate. Arguably returning NaN is more > correct than returning the smallest non NaN anyway. > No telling what compiler optimizations might do with '!(a >= b)' if they assume that '!(a >= b)' == 'a < b'. For instance, if !(a >= b) do something; else do otherwise; might branch to the second statement on 'a <b' and fall through to the first otherwise. Chuck |