Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5362b35

Browse files
committed
BUG: Test aginst +/-TANH_HUGE
This is a bug introduced when adapting the FreeBSD implementation. Since they play some games extracting parts of the double and comparing them as unsigned ints and we don't. We don't since that doesn't generalize to float, and long double as we do in npy_math_complex.c.src
1 parent d504ea1 commit 5362b35

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

numpy/core/src/npymath/npy_math_complex.c.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ static NPY_INLINE @ctype@ cmuli@c@(@ctype@ a)
556556
* approximation sinh^2(huge) ~= exp(2*huge) / 4.
557557
* We use a modified formula to avoid spurious overflow.
558558
*/
559-
if (x >= TANH@C@_HUGE) {
559+
if (npy_fabs@c@(x) >= TANH@C@_HUGE) {
560560
@type@ exp_mx = npy_exp@c@(-npy_fabs@c@(x));
561561
return (npy_cpack@c@(npy_copysign@c@(1, x),
562562
4 * npy_sin@c@(y) * npy_cos@c@(y) * exp_mx * exp_mx));

0 commit comments

Comments
 (0)