summaryrefslogtreecommitdiffstats
path: root/libm/upstream-freebsd/lib/msun/src/s_csqrt.c
diff options
context:
space:
mode:
Diffstat (limited to 'libm/upstream-freebsd/lib/msun/src/s_csqrt.c')
-rw-r--r--libm/upstream-freebsd/lib/msun/src/s_csqrt.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libm/upstream-freebsd/lib/msun/src/s_csqrt.c b/libm/upstream-freebsd/lib/msun/src/s_csqrt.c
index 18a7ae3..c908a2d 100644
--- a/libm/upstream-freebsd/lib/msun/src/s_csqrt.c
+++ b/libm/upstream-freebsd/lib/msun/src/s_csqrt.c
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: head/lib/msun/src/s_csqrt.c 275819 2014-12-16 09:21:56Z ed $");
#include <complex.h>
#include <float.h>
@@ -58,12 +58,12 @@ csqrt(double complex z)
/* Handle special cases. */
if (z == 0)
- return (cpack(0, b));
+ return (CMPLX(0, b));
if (isinf(b))
- return (cpack(INFINITY, b));
+ return (CMPLX(INFINITY, b));
if (isnan(a)) {
t = (b - b) / (b - b); /* raise invalid if b is not a NaN */
- return (cpack(a, t)); /* return NaN + NaN i */
+ return (CMPLX(a, t)); /* return NaN + NaN i */
}
if (isinf(a)) {
/*
@@ -73,9 +73,9 @@ csqrt(double complex z)
* csqrt(-inf + y i) = 0 + inf i
*/
if (signbit(a))
- return (cpack(fabs(b - b), copysign(a, b)));
+ return (CMPLX(fabs(b - b), copysign(a, b)));
else
- return (cpack(a, copysign(b - b, b)));
+ return (CMPLX(a, copysign(b - b, b)));
}
/*
* The remaining special case (b is NaN) is handled just fine by
@@ -94,10 +94,10 @@ csqrt(double complex z)
/* Algorithm 312, CACM vol 10, Oct 1967. */
if (a >= 0) {
t = sqrt((a + hypot(a, b)) * 0.5);
- result = cpack(t, b / (2 * t));
+ result = CMPLX(t, b / (2 * t));
} else {
t = sqrt((-a + hypot(a, b)) * 0.5);
- result = cpack(fabs(b) / (2 * t), copysign(t, b));
+ result = CMPLX(fabs(b) / (2 * t), copysign(t, b));
}
/* Rescale. */