Skip to content

Commit 5775c00

Browse files
authored
[3.13] Revert "gh-136006: fix Py_NAN expansion on Solaris systems (GH-136575) (#138734)" (#139239)
This reverts commit df34903 as discussed in #138733 (comment)
1 parent df8ae28 commit 5775c00

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

Include/pymath.h

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,24 +54,9 @@
5454

5555
/* Py_NAN: Value that evaluates to a quiet Not-a-Number (NaN). The sign is
5656
* undefined and normally not relevant, but e.g. fixed for float("nan").
57-
*
58-
* Note: On Solaris, NAN is a function address, hence arithmetic is impossible.
59-
* For that reason, we instead use the built-in call if available or fallback
60-
* to a generic NaN computed from strtod() as a last resort.
61-
*
62-
* See https://github.com/python/cpython/issues/136006 for details.
6357
*/
6458
#if !defined(Py_NAN)
65-
# if defined(__sun)
66-
# if _Py__has_builtin(__builtin_nanf)
67-
# define Py_NAN ((double)__builtin_nanf(""))
68-
# else
69-
# include <stdlib.h>
70-
# define Py_NAN (strtod("NAN", NULL))
71-
# endif
72-
# else
73-
# define Py_NAN ((double)NAN)
74-
# endif
59+
# define Py_NAN ((double)NAN)
7560
#endif
7661

7762
#endif /* Py_PYMATH_H */

Misc/NEWS.d/next/C API/2025-07-08-22-07-54.gh-issue-136006.XRU5w4.rst

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

0 commit comments

Comments
 (0)