[Numpy-discussion] np.longlong casts to int

Matthew Brett matthew.brett@gmail....
Thu Feb 23 18:00:18 CST 2012


Hi,

On Thu, Feb 23, 2012 at 2:56 PM, Pierre Haessig
<pierre.haessig@crans.org> wrote:
> Le 23/02/2012 20:08, Mark Wiebe a écrit :
>> +1, I think it's good for its name to correspond to the name in C/C++,
>> so that when people search for information on it they will find the
>> relevant information more easily. With a bunch of NumPy-specific
>> aliases, it just creates more hassle for everybody.
> I don't fully agree.
>
> First, this assumes that people were "C-educated", at least a bit. I got
> some C education, but I spent most of my scientific programming time
> sitting in front of Python, Matlab, and a bit of R (in that order). In
> this context, double, floats, long  and short are all esoteric incantation.
> Second the C/C++ names are very unprecise with regards to their memory
> content, and sometimes platform dependent. On the other "float64" is
> very informative.

Right - no proposal to change float64 because it's not ambiguous - it
is both binary64 IEEE floating point format and 64 bit width.

The confusion here is for float128 - which is very occasionally IEEE
binary128 and can be at least two other things (PPC twin double, and
Intel 80 bit padded to 128 bits).  Some of us were also surprised to
find float96 is the same precision as float128 (being an 80 bit Intel
padded to 96 bits).

The renaming is an attempt to make it less confusing.   Do you agree
the renaming is less confusing?  Do you have another proposal?

Preferring 'longdouble' is precisely to flag up to people that they
may need to do some more research to find out what exactly that is.
Which is correct :)

Best,

Matthew


More information about the NumPy-Discussion mailing list