mirror of
https://github.com/python/cpython.git
synced 2024-12-12 19:33:52 +08:00
gh-121889: cmath.acosh(0+nanj) returns nan+pi/2j (#121892)
As per C11 DR#471 (adjusted resolution accepted for C17), cacosh (0 + iNaN) should return NaN ± i pi/2, not NaN + iNaN. This patch fixes cmath's code to do same.
This commit is contained in:
parent
151934a324
commit
3462a80d2c
@ -371,9 +371,9 @@ acosh1002 acosh 0.0 inf -> inf 1.5707963267948966
|
||||
acosh1003 acosh 2.3 inf -> inf 1.5707963267948966
|
||||
acosh1004 acosh -0.0 inf -> inf 1.5707963267948966
|
||||
acosh1005 acosh -2.3 inf -> inf 1.5707963267948966
|
||||
acosh1006 acosh 0.0 nan -> nan nan
|
||||
acosh1006 acosh 0.0 nan -> nan 1.5707963267948966 ignore-imag-sign
|
||||
acosh1007 acosh 2.3 nan -> nan nan
|
||||
acosh1008 acosh -0.0 nan -> nan nan
|
||||
acosh1008 acosh -0.0 nan -> nan 1.5707963267948966 ignore-imag-sign
|
||||
acosh1009 acosh -2.3 nan -> nan nan
|
||||
acosh1010 acosh -inf 0.0 -> inf 3.1415926535897931
|
||||
acosh1011 acosh -inf 2.3 -> inf 3.1415926535897931
|
||||
|
@ -0,0 +1 @@
|
||||
Adjusts ``cmath.acosh(complex('0+nanj'))`` for recent C standards.
|
@ -1259,8 +1259,8 @@ cmath_exec(PyObject *mod)
|
||||
INIT_SPECIAL_VALUES(acosh_special_values, {
|
||||
C(INF,-P34) C(INF,-P) C(INF,-P) C(INF,P) C(INF,P) C(INF,P34) C(INF,N)
|
||||
C(INF,-P12) C(U,U) C(U,U) C(U,U) C(U,U) C(INF,P12) C(N,N)
|
||||
C(INF,-P12) C(U,U) C(0.,-P12) C(0.,P12) C(U,U) C(INF,P12) C(N,N)
|
||||
C(INF,-P12) C(U,U) C(0.,-P12) C(0.,P12) C(U,U) C(INF,P12) C(N,N)
|
||||
C(INF,-P12) C(U,U) C(0.,-P12) C(0.,P12) C(U,U) C(INF,P12) C(N,P12)
|
||||
C(INF,-P12) C(U,U) C(0.,-P12) C(0.,P12) C(U,U) C(INF,P12) C(N,P12)
|
||||
C(INF,-P12) C(U,U) C(U,U) C(U,U) C(U,U) C(INF,P12) C(N,N)
|
||||
C(INF,-P14) C(INF,-0.) C(INF,-0.) C(INF,0.) C(INF,0.) C(INF,P14) C(INF,N)
|
||||
C(INF,N) C(N,N) C(N,N) C(N,N) C(N,N) C(INF,N) C(N,N)
|
||||
|
Loading…
Reference in New Issue
Block a user