Skip to content
Merged
8 changes: 0 additions & 8 deletions Doc/c-api/float.rst
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,6 @@ endian processor, or ``0`` on little endian processor.
Return value: ``0`` if all is OK, ``-1`` if error (and an exception is set,
most likely :exc:`OverflowError`).

There are two problems on non-IEEE platforms:

* What this does is undefined if *x* is a NaN or infinity.
* ``-0.0`` and ``+0.0`` produce the same bytes string.

.. c:function:: int PyFloat_Pack2(double x, char *p, int le)

Pack a C double as the IEEE 754 binary16 half-precision format.
Expand Down Expand Up @@ -256,9 +251,6 @@ Return value: The unpacked double. On error, this is ``-1.0`` and
:c:func:`PyErr_Occurred` is true (and an exception is set, most likely
:exc:`OverflowError`).

Note that on a non-IEEE platform this will refuse to unpack a bytes string that
represents a NaN or infinity.

.. c:function:: double PyFloat_Unpack2(const char *p, int le)

Unpack the IEEE 754 binary16 half-precision format as a C double.
Expand Down
3 changes: 1 addition & 2 deletions Include/internal/pycore_pymath.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ extern void _Py_set_387controlword(unsigned short);
// (extended precision), and we don't know how to change
// the rounding precision.
#if !defined(DOUBLE_IS_LITTLE_ENDIAN_IEEE754) && \
!defined(DOUBLE_IS_BIG_ENDIAN_IEEE754) && \
!defined(DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754)
!defined(DOUBLE_IS_BIG_ENDIAN_IEEE754)
# define _PY_SHORT_FLOAT_REPR 0
#endif

Expand Down
1 change: 0 additions & 1 deletion Include/pymacconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#undef SIZEOF_UINTPTR_T
#undef SIZEOF_PTHREAD_T
#undef WORDS_BIGENDIAN
#undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754
#undef DOUBLE_IS_BIG_ENDIAN_IEEE754
#undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754
#undef HAVE_GCC_ASM_FOR_X87
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Remove support for ancient ARM platforms, using mixed-endian representation
for doubles. Patch by Sergey B Kirpichev.
4 changes: 2 additions & 2 deletions Objects/clinic/floatobject.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading