[3.13] gh-144173: fix flaky test_complex.test_truediv() (GH-144355) (#145767)
gh-144173: fix flaky test_complex.test_truediv() (GH-144355) Previously, component-wise relative error bound was tested. However, such bound can't exist already for complex multiplication as one can be used to perform subtraction of floating-point numbers, e.g. x and y for z0=1+1j and z1=x+yj. ```pycon >>> x, y = 1e-9+1j, 1+1j >>> a = x*y*y.conjugate()/2;a (1.0000000272292198e-09+1j) >>> b = x*(y*y.conjugate()/2);b (1e-09+1j) >>> b == x True >>> (a.real-b.real)/math.ulp(b.real) 131672427.0 ``` (cherry picked from commit c4333a12708a917d1cfb6418c04be45793ecc392) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
M
Miss Islington (bot) committed
f349433df04090cd6c6a4934c0e5914b63afef2e
Parent: b5082d8
Committed by GitHub <noreply@github.com>
on 3/10/2026, 5:05:07 PM