x.min() depends on ordering

Charles R Harris charlesr.harris at gmail.com
Sat Nov 11 18:09:44 CST 2006

On 11/11/06, Tim Hochberg <tim.hochberg at ieee.org> wrote:
> Robert Kern wrote:


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;
    do otherwise;

might branch to the second statement on  'a <b' and fall through to the
first otherwise.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20061111/272945c6/attachment-0001.html 
-------------- next part --------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
-------------- next part --------------
Numpy-discussion mailing list
Numpy-discussion at lists.sourceforge.net

More information about the Numpy-discussion mailing list