about summary refs log tree commit diff
path: root/src/complex/cprojl.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2022-01-18 17:31:46 -0500
committerRich Felker <dalias@aerifal.cx>2022-01-18 17:31:46 -0500
commit75b3412f3dbda8f1fc6818b8b0cf1d0737c2163c (patch)
tree95b73f346323f3d30cedd8a25d19039b1392e38b /src/complex/cprojl.c
parent52f0deb96975401d9f13334dc37f907630224af7 (diff)
downloadmusl-75b3412f3dbda8f1fc6818b8b0cf1d0737c2163c.tar.gz
musl-75b3412f3dbda8f1fc6818b8b0cf1d0737c2163c.tar.xz
musl-75b3412f3dbda8f1fc6818b8b0cf1d0737c2163c.zip
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/cprojl.c')
-rw-r--r--src/complex/cprojl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/complex/cprojl.c b/src/complex/cprojl.c
index 38a494c5..531ffa1c 100644
--- a/src/complex/cprojl.c
+++ b/src/complex/cprojl.c
@@ -9,7 +9,7 @@ long double complex cprojl(long double complex z)
 long double complex cprojl(long double complex z)
 {
 	if (isinf(creall(z)) || isinf(cimagl(z)))
-		return CMPLXL(INFINITY, copysignl(0.0, creall(z)));
+		return CMPLXL(INFINITY, copysignl(0.0, cimagl(z)));
 	return z;
 }
 #endif