[Numpy-discussion] Complex nan ordering

Pauli Virtanen pav@iki...
Mon Jul 19 03:02:35 CDT 2010


 > However, nans have been propagated by maximum and minimum since 1.4.0.
> There was a question, discussed on the list, as to what 'nan' complex to
> return in the propagation, but it was still a nan complex in your
> definition of such objects. The final choice was driven by using the
> first of the already available complex nans as it was the easiest thing
> to do. However, (nan, nan) would be just as easy to do now that nans are
> available. 

Then we would be creating an inconsistency between amax/argmax. Of course if we say all cnans are equivalent, it doesn't matter.

> I'm not sure what your modifications to the macros buys us,
> what do you want to achieve?

1) fix bugs in nan propagation,

maximum(1, complex(0, nan))

used to return 1. The result also depended previously on the order of arguments.

2) make complex nan behave similarly as a real nan in comparisons (non-sorting).

I think both of these are worthwhile.

    Pauli



More information about the NumPy-Discussion mailing list