diff options
author | Rich Felker <dalias@aerifal.cx> | 2022-01-18 17:31:46 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2022-01-18 17:31:46 -0500 |
commit | 75b3412f3dbda8f1fc6818b8b0cf1d0737c2163c (patch) | |
tree | 95b73f346323f3d30cedd8a25d19039b1392e38b /src/complex/cprojf.c | |
parent | make fseek detect and produce an error for invalid whence arguments (diff) | |
download | grovel-75b3412f3dbda8f1fc6818b8b0cf1d0737c2163c.tar.gz grovel-75b3412f3dbda8f1fc6818b8b0cf1d0737c2163c.tar.xz |
fix potentially wrong-sign zero in cproj functions at infinity
these are specified to use the sign of the imaginary part of the input
as the sign of zero in the result, but wrongly copied the sign of the
real part.
Diffstat (limited to 'src/complex/cprojf.c')
-rw-r--r-- | src/complex/cprojf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/complex/cprojf.c b/src/complex/cprojf.c index 03fab339..15a874bb 100644 --- a/src/complex/cprojf.c +++ b/src/complex/cprojf.c @@ -3,6 +3,6 @@ float complex cprojf(float complex z) { if (isinf(crealf(z)) || isinf(cimagf(z))) - return CMPLXF(INFINITY, copysignf(0.0, crealf(z))); + return CMPLXF(INFINITY, copysignf(0.0, cimagf(z))); return z; } |