summaryrefslogtreecommitdiffstats
path: root/lib/msun/src/s_csqrtf.c
diff options
context:
space:
mode:
authordas <das@FreeBSD.org>2008-01-11 04:18:25 +0000
committerdas <das@FreeBSD.org>2008-01-11 04:18:25 +0000
commitc7fe2c294acd6b2c41ab00906f9ec475a0e9d4dc (patch)
tree933ea958d0e1f6d2264536d072ac65cb21ea4abf /lib/msun/src/s_csqrtf.c
parentbc3858933dfca9403c35f6cc517a84f827e69f17 (diff)
downloadFreeBSD-src-c7fe2c294acd6b2c41ab00906f9ec475a0e9d4dc.zip
FreeBSD-src-c7fe2c294acd6b2c41ab00906f9ec475a0e9d4dc.tar.gz
- Correct the range check in the double version to catch negative values
that would overflow. - Style fixes and improved handling of NaNs suggested by bde.
Diffstat (limited to 'lib/msun/src/s_csqrtf.c')
-rw-r--r--lib/msun/src/s_csqrtf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/msun/src/s_csqrtf.c b/lib/msun/src/s_csqrtf.c
index cc5485a..6c70ac1 100644
--- a/lib/msun/src/s_csqrtf.c
+++ b/lib/msun/src/s_csqrtf.c
@@ -54,13 +54,13 @@ csqrtf(float complex z)
return (cpackf(INFINITY, b));
if (isnan(a)) {
t = (b - b) / (b - b); /* raise invalid if b is not a NaN */
- return (cpackf(t, t)); /* return NaN + NaN i */
+ return (cpackf(a, t)); /* return NaN + NaN i */
}
if (isinf(a)) {
/*
- * csqrtf(inf + nan i) = inf + nan i
+ * csqrtf(inf + NaN i) = inf + NaN i
* csqrtf(inf + y i) = inf + 0 i
- * csqrtf(-inf + nan i) = nan +- inf i
+ * csqrtf(-inf + NaN i) = NaN +- inf i
* csqrtf(-inf + y i) = 0 + inf i
*/
if (signbit(a))
OpenPOWER on IntegriCloud