On Sun, Feb 8, 2009 at 8:02 AM, <[email protected]> wrote: > But I just found that nan in the exponent in an array are not propagated: > >>>> 0.0 ** np.array([-np.nan, 0, 1], dtype=np.int32)[0] > 1.0 >>>> np.power(0.0, np.array([-np.nan, 0, 1], dtype=np.int32)[0]) > 1.0
correction: np.power propagates nans, it's again the casting of nan to zero int, that tripped me up. I shouln't cut and paste examples too fast. >>> np.power(0.0, np.array([-np.nan, 0, 1])) array([ NaN, 1., 0.]) >>> np.power(0.0, np.array([-np.nan, 0, 1]))[0] 1.#QNAN Josef _______________________________________________ Numpy-discussion mailing list [email protected] http://projects.scipy.org/mailman/listinfo/numpy-discussion
