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 /Modules/mathmodule.c | |
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 'Modules/mathmodule.c')
-rw-r--r-- | Modules/mathmodule.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index ad23dad..7e8d8b3 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -438,7 +438,7 @@ m_tgamma(double x) } else { errno = ERANGE; - return Py_HUGE_VAL; + return Py_INFINITY; } } @@ -502,14 +502,14 @@ m_lgamma(double x) if (isnan(x)) return x; /* lgamma(nan) = nan */ else - return Py_HUGE_VAL; /* lgamma(+-inf) = +inf */ + return Py_INFINITY; /* lgamma(+-inf) = +inf */ } /* integer arguments */ if (x == floor(x) && x <= 2.0) { if (x <= 0.0) { errno = EDOM; /* lgamma(n) = inf, divide-by-zero for */ - return Py_HUGE_VAL; /* integers n <= 0 */ + return Py_INFINITY; /* integers n <= 0 */ } else { return 0.0; /* lgamma(1) = lgamma(2) = 0.0 */ @@ -645,7 +645,7 @@ m_log(double x) return log(x); errno = EDOM; if (x == 0.0) - return -Py_HUGE_VAL; /* log(0) = -inf */ + return -Py_INFINITY; /* log(0) = -inf */ else return Py_NAN; /* log(-ve) = nan */ } @@ -688,7 +688,7 @@ m_log2(double x) } else if (x == 0.0) { errno = EDOM; - return -Py_HUGE_VAL; /* log2(0) = -inf, divide-by-zero */ + return -Py_INFINITY; /* log2(0) = -inf, divide-by-zero */ } else { errno = EDOM; @@ -704,7 +704,7 @@ m_log10(double x) return log10(x); errno = EDOM; if (x == 0.0) - return -Py_HUGE_VAL; /* log10(0) = -inf */ + return -Py_INFINITY; /* log10(0) = -inf */ else return Py_NAN; /* log10(-ve) = nan */ } @@ -2126,7 +2126,7 @@ math_ldexp_impl(PyObject *module, double x, PyObject *i) errno = 0; } else if (exp > INT_MAX) { /* overflow */ - r = copysign(Py_HUGE_VAL, x); + r = copysign(Py_INFINITY, x); errno = ERANGE; } else if (exp < INT_MIN) { /* underflow to +-0 */ |