diff options
author | Sergey B Kirpichev <skirpichev@gmail.com> | 2024-11-01 22:04:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-01 22:04:31 (GMT) |
commit | 8477951a1c460ff9b7dc7c54e7bf9b66b1722459 (patch) | |
tree | 56f840c81726ce48b4a99f0ee4eb358ccef0f38f /Python | |
parent | 28b148fb32e4548b461137d18d1ab6d366395d36 (diff) | |
download | cpython-8477951a1c460ff9b7dc7c54e7bf9b66b1722459.zip cpython-8477951a1c460ff9b7dc7c54e7bf9b66b1722459.tar.gz cpython-8477951a1c460ff9b7dc7c54e7bf9b66b1722459.tar.bz2 |
gh-120026: soft deprecate Py_HUGE_VAL macro (#120027)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Diffstat (limited to 'Python')
-rw-r--r-- | Python/pystrtod.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/pystrtod.c b/Python/pystrtod.c index 2f2b588..7b74f61 100644 --- a/Python/pystrtod.c +++ b/Python/pystrtod.c @@ -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. |