Skip to content

Commit f66ff85

Browse files
committed
gh-138580: revert PR 138811
This reverts commit 68c7fad.
1 parent c75d220 commit f66ff85

File tree

6 files changed

+7
-30
lines changed

6 files changed

+7
-30
lines changed

Doc/library/math.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,7 @@ Constants
848848

849849
The :mod:`!math` module consists mostly of thin wrappers around the platform C
850850
math library functions. Behavior in exceptional cases follows Annex F of
851-
the C99 standard, if :attr:`sys.float_info.iec_60559` is true.
852-
The current implementation will raise
851+
the C99 standard where appropriate. The current implementation will raise
853852
:exc:`ValueError` for invalid operations like ``sqrt(-1.0)`` or ``log(0.0)``
854853
(where C99 Annex F recommends signaling invalid operation or divide-by-zero),
855854
and :exc:`OverflowError` for results that overflow (for example,

Doc/library/sys.rst

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -694,16 +694,15 @@ always available. Unless explicitly noted otherwise, all variables are read-only
694694
A :term:`named tuple` holding information about the float type. It
695695
contains low level information about the precision and internal
696696
representation. The values correspond to the various floating-point
697-
constants defined by C implementation and in the standard header file
698-
:file:`float.h` for the 'C' programming language; see Annex F and section
699-
5.2.4.2.2 of the 1999 ISO/IEC C standard [C99]_, 'Characteristics of
700-
floating types', for details.
697+
constants defined in the standard header file :file:`float.h` for the 'C'
698+
programming language; see section 5.2.4.2.2 of the 1999 ISO/IEC C standard
699+
[C99]_, 'Characteristics of floating types', for details.
701700

702701
.. list-table:: Attributes of the :data:`!float_info` :term:`named tuple`
703702
:header-rows: 1
704703

705704
* - attribute
706-
- C macro
705+
- float.h macro
707706
- explanation
708707

709708
* - .. attribute:: float_info.epsilon
@@ -772,12 +771,6 @@ always available. Unless explicitly noted otherwise, all variables are read-only
772771
All other values for :c:macro:`!FLT_ROUNDS` characterize
773772
implementation-defined rounding behavior.
774773

775-
* - .. attribute:: float_info.iec_60559
776-
- :c:macro:`!__STDC_IEC_559__`
777-
- A boolean, indicating support the IEC 60559 floating-point standard.
778-
If true, the :class:`float` type characteristics and behavior matches
779-
the IEC 60559 double format.
780-
781774
The attribute :attr:`sys.float_info.dig` needs further explanation. If
782775
``s`` is any string representing a decimal number with at most
783776
:attr:`!sys.float_info.dig` significant digits, then converting ``s`` to a

Doc/whatsnew/3.15.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,11 +1028,6 @@ sys
10281028
* Add :data:`sys.abi_info` namespace to improve access to ABI information.
10291029
(Contributed by Klaus Zimmermann in :gh:`137476`.)
10301030

1031-
* Add :data:`sys.float_info.iec_60559 <sys.float_info>`: a boolean flag,
1032-
indicating support the IEC 60559 floating-point standard (as specified by the
1033-
Annex F of C99).
1034-
(Contributed by Sergey B Kirpichev in :gh:`138580`.)
1035-
10361031

10371032
tarfile
10381033
-------

Lib/test/test_sys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ def test_attributes(self):
641641
self.assertIsInstance(sys.exec_prefix, str)
642642
self.assertIsInstance(sys.base_exec_prefix, str)
643643
self.assertIsInstance(sys.executable, str)
644-
self.assertEqual(len(sys.float_info), 12)
644+
self.assertEqual(len(sys.float_info), 11)
645645
self.assertEqual(sys.float_info.radix, 2)
646646
self.assertEqual(len(sys.int_info), 4)
647647
self.assertTrue(sys.int_info.bits_per_digit % 5 == 0)

Misc/NEWS.d/next/Library/2025-09-12-07-30-13.gh-issue-138580.Qr_fSH.rst

Lines changed: 0 additions & 3 deletions
This file was deleted.

Objects/floatobject.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,14 @@ static PyStructSequence_Field floatinfo_fields[] = {
6868
{"radix", "FLT_RADIX -- radix of exponent"},
6969
{"rounds", "FLT_ROUNDS -- rounding mode used for arithmetic "
7070
"operations"},
71-
{"iec_60559", "test if implementation supports the IEC 60559 "
72-
"floating-point standard"},
7371
{0}
7472
};
7573

7674
static PyStructSequence_Desc floatinfo_desc = {
7775
"sys.float_info", /* name */
7876
floatinfo__doc__, /* doc */
7977
floatinfo_fields, /* fields */
80-
12
78+
11
8179
};
8280

8381
PyObject *
@@ -115,11 +113,6 @@ PyFloat_GetInfo(void)
115113
SetDblFlag(DBL_EPSILON);
116114
SetIntFlag(FLT_RADIX);
117115
SetIntFlag(FLT_ROUNDS);
118-
#ifdef __STDC_IEC_559__
119-
SetFlag(PyBool_FromLong(1));
120-
#else
121-
SetFlag(PyBool_FromLong(0));
122-
#endif
123116
#undef SetIntFlag
124117
#undef SetDblFlag
125118
#undef SetFlag

0 commit comments

Comments
 (0)