[Numpy-discussion] What type should / return in python 3k whenapplied to two integer types?

Charles R Harris charlesr.harris@gmail....
Thu Aug 27 13:54:28 CDT 2009


On Thu, Aug 27, 2009 at 12:50 PM, Charles R Harris <
charlesr.harris@gmail.com> wrote:

>
>
> 2009/8/27 Nadav Horesh <nadavh@visionsense.com>
>
>> Double is the natural choice, there is a possibility of long double
>> (float96 on x86 or float128 on amd64) where there is no precision loss. Is
>> this option portable?
>
>
> Not really. The long double type can be a bit weird and varies from
> architecture to architecture.
>

The real problem is deciding what to do with integer precisions that fit in
float32.  At present we have

In [2]: x = ones(1, dtype=int16)

In [3]: true_divide(x,x)
Out[3]: array([ 1.], dtype=float32)

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090827/13178c22/attachment.html 


More information about the NumPy-Discussion mailing list