[Numpy-discussion] What type should / return in python 3k whenapplied to two integer types?
Charles R Harris
charlesr.harris at gmail.com
Thu Aug 27 14:54:28 EDT 2009
On Thu, Aug 27, 2009 at 12:50 PM, Charles R Harris <
charlesr.harris at gmail.com> wrote:
>
>
> 2009/8/27 Nadav Horesh <nadavh at 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.python.org/pipermail/numpy-discussion/attachments/20090827/13178c22/attachment.html>
More information about the NumPy-Discussion
mailing list