Commit e385873
committed
gh-157859: Fix cmath.atanh() returning inf at ±1 ± sqrt(DBL_MIN)*1j
cmath_atanh_impl() selects its near-pole formula with
`ay < CM_SQRT_DBL_MIN`. At equality the general formula computes
4/(0 + ay*ay) = 4/DBL_MIN, which overflows, so the finite input
1 + 2**-511j (and its three sign/conjugate mirrors, and the
corresponding cmath.atan() inputs) returned inf. Use `<=` so the
boundary word takes the near-pole formula, which is accurate there.1 parent 6b97452 commit e385873
3 files changed
Lines changed: 18 additions & 1 deletion
File tree
- Lib/test/mathdata
- Misc/NEWS.d/next/Library
- Modules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
853 | 853 | | |
854 | 854 | | |
855 | 855 | | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
856 | 863 | | |
857 | 864 | | |
858 | 865 | | |
| |||
1043 | 1050 | | |
1044 | 1051 | | |
1045 | 1052 | | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
1046 | 1061 | | |
1047 | 1062 | | |
1048 | 1063 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
385 | | - | |
| 385 | + | |
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| |||
0 commit comments