Mark Dickinson <dicki...@gmail.com> added the comment:

I've only glanced at the patch, but a couple of things:

(1) It looks as though the patch assumes that a C double is IEEE 754 binary64 
format, and that a C float is IEEE 754 binary32 format.  Is that correct?

If so, that's a significant break with tradition:  Python's supposed to be able 
to work with the native doubles, no matter what their format.  I, for one, 
wouldn't object if IEEE floating-point were made a requirement for Python >= 
3.3, but this change would need to be discussed on the python-dev mailing list.

(2)  The

  typedef PY_LONG_LONG npy_uint64;

looks wrong to me for two reasons:  first, PY_LONG_LONG is a signed type.  
Second, while it's guaranteed (by the C standard) that unsigned long long will 
have width at least 64, it's not guaranteed that it'll be exactly 64.  Does the 
code depend on this assumption?  Similarly when using unsigned int in the union 
for the 32-bit code;  here it's not even guaranteed by the standards that 
unsigned int has width at least 32.

It may be better to use the PY_UINT64_T type and the HAVE_UINT64_T macros, and 
similarly for the 32-bit types.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11734>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to