Converting bool to float

Charles R Harris charlesr.harris at
Wed Nov 1 23:55:39 CST 2006

On 11/1/06, Robert Kern <robert.kern at> wrote:
> Tim Hochberg wrote:
> > Travis Oliphant wrote:


However, whether or not float32 arrays operated with Python float scalars
> give
> float32 or float64 arrays is tangential to my question. Does anyone
> actually
> think that a Python float operated with a boolean array should give a
> float32
> result? Must we *up*cast a boolean array to float64 to preserve the
> precision of
> the scalar?

Probably doesn't matter most of the time, I suppose, who is going to check?
I tend to think doubles because they are a bit faster on the x86
architecture and because they are a pretty common default.

-------------- next part --------------
An HTML attachment was scrubbed...
-------------- 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

More information about the Numpy-discussion mailing list