Eli Stevens added the comment:
Updated patch with changes suggested by Mark Wiebe. I also removed the
commented-out "if (!(e == 0 && f == 0.0))" part.
It feels like the patch is approaching an acceptable state; after both of you
agree it's there, wh
Changes by Eli Stevens :
Removed file: http://bugs.python.org/file21499/cpython-struct-float16-v3.patch
___
Python tracker
<http://bugs.python.org/issue11734>
___
___
Changes by Eli Stevens :
Removed file: http://bugs.python.org/file21497/cpython-struct-float16-v1.patch
___
Python tracker
<http://bugs.python.org/issue11734>
___
___
Eli Stevens added the comment:
All four changes suggested via review from Mark Dickinson have been made. One
note: the else if (!(e == 0 && f == 0.0)) { change was made; this makes the
Pack2 function parallel the Pack4 function slightly less. I agree that it's
cleaner this
Eli Stevens added the comment:
Made the _PyFloat_Pack2 match the algo in _PyFloat_Pack4, and did similar for
Unpack. This should work on platforms that don't have IEEE 754 floats except
for situations where an INF or NAN is unpacked (this is the same as the Unpack4
behavior).
This
Eli Stevens added the comment:
More questions:
The current _PyFloat_Pack4 doesn't round to even:
fbits = (unsigned int)(f + 0.5); /* Round */
Is the mismatch going to be a problem? Should I change the _PyFloat_Pack4
implementation while I'
Eli Stevens added the comment:
I see the distinction about the rounding error now. Thanks for clarifying;
I've added more tests as suggested.
Looking at _struct.c, line 2085:
/* Skip float and double, could be
"unknown&quo
Eli Stevens added the comment:
There seems to be some disagreement about the double-rounding issue; Mark
Dickinson posted on python-ideas that he doesn't think that there is one. If
possible, I think that removing code paths that aren't needed are generally a
good thing, especia
Changes by Eli Stevens :
Removed file: http://bugs.python.org/file21498/cpython-struct-float16-v2.patch
___
Python tracker
<http://bugs.python.org/issue11734>
___
___
Eli Stevens added the comment:
Ahh, yes, much cleaner. Thank you. :) I'll remove the previous version.
--
Added file: http://bugs.python.org/file21499/cpython-struct-float16-v3.patch
___
Python tracker
<http://bugs.python.org/is
Eli Stevens added the comment:
I've spelled "HAS_INT64_TYPE" as follows:
+#if SIZEOF_LONG == 8 || SIZEOF_LONG_LONG == 8
+#if SIZEOF_LONG == 8
+typedef unsigned long npy_uint64;
+#else
+#if SIZEOF_LONG_LONG == 8
+typedef unsigned long long npy_uint64;
+#endif
+#endif
Eli Stevens added the comment:
I'm thinking of taking the current float implementation and wrapping it with
something like:
#if HAS_INT64_TYPE
// double implementation goes here
#else
// float implementation here (what's in the current patch)
...
#endif
Does this s
Eli Stevens added the comment:
Initial patch; tests pass. A couple notes:
- I manually excised some commented changes to structmodule.{h,c} from the
.patch; once I get a determination on if those files need to be updated or not
I will discard the changes or implement what needs to be done
New submission from Eli Stevens :
Numpy 1.6.0 adds support for a half-float (16-bit) data type, but
cannot currently export a buffer interface to the data since neither PEP 3118
nor the struct module (referenced by PEP 3118) support the data type.
I am proposing that the struct module be
14 matches
Mail list logo