lib/msun: cpow{,f,l}(CMLX(0.0, 0.0)) should return 1.0

PR:	289447
MFC after:	1 week
This commit is contained in:
Steve Kargl
2025-09-11 19:38:17 +03:00
committed by Konstantin Belousov
parent d869395ac4
commit 8b41ba845c
3 changed files with 12 additions and 3 deletions
+4 -1
View File
@@ -58,7 +58,10 @@ cpow(double complex a, double complex z)
y = cimag (z);
absa = cabs (a);
if (absa == 0.0) {
return (CMPLX(0.0, 0.0));
if (x == 0 && y == 0)
return (CMPLX(1., 0.));
else
return (CMPLX(0., 0.));
}
arga = carg (a);
r = pow (absa, x);
+4 -1
View File
@@ -57,7 +57,10 @@ cpowf(float complex a, float complex z)
y = cimagf(z);
absa = cabsf (a);
if (absa == 0.0f) {
return (CMPLXF(0.0f, 0.0f));
if (x == 0 && y == 0)
return (CMPLXF(1.f, 0.f));
else
return (CMPLXF(0.f, 0.f));
}
arga = cargf (a);
r = powf (absa, x);
+4 -1
View File
@@ -57,7 +57,10 @@ cpowl(long double complex a, long double complex z)
y = cimagl(z);
absa = cabsl(a);
if (absa == 0.0L) {
return (CMPLXL(0.0L, 0.0L));
if (x == 0 && y == 0)
return (CMPLXL(1.L, 0.L));
else
return (CMPLXL(0.L, 0.L));
}
arga = cargl(a);
r = powl(absa, x);