diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-11-15 08:37:58 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-11-15 08:37:58 -0500 |
commit | 8bb181622222f2ee3462c8b021bcae4fcdbbd37a (patch) | |
tree | 166a1be834c8cd5a4c2521d41d7ee506bd8c8e51 /src/complex/csqrtf.c | |
parent | 22781b4d8ecaf97ac52d2a501a2e7d3bc1920ce0 (diff) | |
parent | 68847ecd3a644d3ffd9be58603be1a3fa437dff0 (diff) | |
download | musl-8bb181622222f2ee3462c8b021bcae4fcdbbd37a.tar.gz musl-8bb181622222f2ee3462c8b021bcae4fcdbbd37a.tar.xz musl-8bb181622222f2ee3462c8b021bcae4fcdbbd37a.zip |
Merge remote-tracking branch 'nsz/math'
Diffstat (limited to 'src/complex/csqrtf.c')
-rw-r--r-- | src/complex/csqrtf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/complex/csqrtf.c b/src/complex/csqrtf.c index 16487c23..ab5102f0 100644 --- a/src/complex/csqrtf.c +++ b/src/complex/csqrtf.c @@ -43,12 +43,12 @@ float complex csqrtf(float complex z) /* Handle special cases. */ if (z == 0) - return cpackf(0, b); + return CMPLXF(0, b); if (isinf(b)) - return cpackf(INFINITY, b); + return CMPLXF(INFINITY, b); if (isnan(a)) { t = (b - b) / (b - b); /* raise invalid if b is not a NaN */ - return cpackf(a, t); /* return NaN + NaN i */ + return CMPLXF(a, t); /* return NaN + NaN i */ } if (isinf(a)) { /* @@ -58,9 +58,9 @@ float complex csqrtf(float complex z) * csqrtf(-inf + y i) = 0 + inf i */ if (signbit(a)) - return cpackf(fabsf(b - b), copysignf(a, b)); + return CMPLXF(fabsf(b - b), copysignf(a, b)); else - return cpackf(a, copysignf(b - b, b)); + return CMPLXF(a, copysignf(b - b, b)); } /* * The remaining special case (b is NaN) is handled just fine by @@ -74,9 +74,9 @@ float complex csqrtf(float complex z) */ if (a >= 0) { t = sqrt((a + hypot(a, b)) * 0.5); - return cpackf(t, b / (2.0 * t)); + return CMPLXF(t, b / (2.0 * t)); } else { t = sqrt((-a + hypot(a, b)) * 0.5); - return cpackf(fabsf(b) / (2.0 * t), copysignf(t, b)); + return CMPLXF(fabsf(b) / (2.0 * t), copysignf(t, b)); } } |