gh-141004: soft-deprecate Py_INFINITY macro (#141033)

Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Sergey B Kirpichev 2025-11-12 15:44:49 +03:00 committed by GitHub
parent c6f3dd6a50
commit e2026731f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 45 additions and 36 deletions

View file

@ -139,8 +139,8 @@ _Py_c_prod(Py_complex z, Py_complex w)
recalc = 1;
}
if (recalc) {
r.real = Py_INFINITY*(a*c - b*d);
r.imag = Py_INFINITY*(a*d + b*c);
r.real = INFINITY*(a*c - b*d);
r.imag = INFINITY*(a*d + b*c);
}
}
@ -229,8 +229,8 @@ _Py_c_quot(Py_complex a, Py_complex b)
{
const double x = copysign(isinf(a.real) ? 1.0 : 0.0, a.real);
const double y = copysign(isinf(a.imag) ? 1.0 : 0.0, a.imag);
r.real = Py_INFINITY * (x*b.real + y*b.imag);
r.imag = Py_INFINITY * (y*b.real - x*b.imag);
r.real = INFINITY * (x*b.real + y*b.imag);
r.imag = INFINITY * (y*b.real - x*b.imag);
}
else if ((isinf(abs_breal) || isinf(abs_bimag))
&& isfinite(a.real) && isfinite(a.imag))