gh-120026: soft deprecate Py_HUGE_VAL macro (#120027)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
Sergey B Kirpichev 2024-11-02 01:04:31 +03:00 committed by GitHub
parent 28b148fb32
commit 8477951a1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 23 additions and 18 deletions

View file

@ -43,7 +43,7 @@ _Py_parse_inf_or_nan(const char *p, char **endptr)
s += 3;
if (case_insensitive_match(s, "inity"))
s += 5;
retval = negate ? -Py_HUGE_VAL : Py_HUGE_VAL;
retval = negate ? -Py_INFINITY : Py_INFINITY;
}
else if (case_insensitive_match(s, "nan")) {
s += 3;
@ -286,7 +286,7 @@ _PyOS_ascii_strtod(const char *nptr, char **endptr)
string, -1.0 is returned and again ValueError is raised.
On overflow (e.g., when trying to convert '1e500' on an IEEE 754 machine),
if overflow_exception is NULL then +-Py_HUGE_VAL is returned, and no Python
if overflow_exception is NULL then +-Py_INFINITY is returned, and no Python
exception is raised. Otherwise, overflow_exception should point to
a Python exception, this exception will be raised, -1.0 will be returned,
and *endptr will point just past the end of the converted value.