<br><br><div class="gmail_quote">On Tue, Apr 12, 2011 at 11:56 AM, Robert Kern <span dir="ltr"><<a href="mailto:robert.kern@gmail.com">robert.kern@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Tue, Apr 12, 2011 at 12:27, Charles R Harris<br>
<<a href="mailto:charlesr.harris@gmail.com">charlesr.harris@gmail.com</a>> wrote:<br>
<br>
> IIRC, the behavior with respect to scalars sort of happened in the code on<br>
> the fly, so this is a good discussion to have. We should end up with<br>
> documented rules and tests to enforce them. I agree with Mark that the tests<br>
> have been deficient up to this point.<br>
<br>
</div>It's been documented for a long time now.<br>
<br>
<a href="http://docs.scipy.org/doc/numpy/reference/ufuncs.html#casting-rules" target="_blank">http://docs.scipy.org/doc/numpy/reference/ufuncs.html#casting-rules</a><br>
<div><div></div><div class="h5"><br></div></div></blockquote><div><br>Nope, the kind stuff is missing. Note the cast to float32 that Mark pointed out. Also that the casting of python integers depends on their sign and magnitude.<br>
<br>In [1]: ones(3, '?') + 0<br>Out[1]: array([1, 1, 1], dtype=int8)<br><br>In [2]: ones(3, '?') + 1000<br>Out[2]: array([1001, 1001, 1001], dtype=int16)<br><br><br>Chuck <br></div><br></div>