Le mardi 8 janvier 2013, Andrew Collette a écrit :

> Hi,
>
> > Keep in mind that in the third option (current 1.6 behavior) the dtype is
> > large enough to hold the random number, but not necessarily to hold the
> > result. So for instance if x is an int16 array with only positive values,
> > the result of this addition may contain negative values (or not,
> depending
> > on the number being drawn). That's the part I feel is flawed with this
> > behavior, it is quite unpredictable.
>
> Yes, certainly.  But in either the proposed or 1.5 behavior, if the
> values in x are close to the limits of the type, this can happen also.
>

My previous email may not have been clear enough, so to be sure: in my
above example, if the random number is 30000, then the result may
contain negative
values (int16). If the random number is 50000, then the result will only
contain positive values (upcast to int32). Do you believe it is a good
behavior?

-=- Olivier
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to