summaryrefslogtreecommitdiffstats
path: root/lib/msun/src
diff options
context:
space:
mode:
authorkargl <kargl@FreeBSD.org>2011-03-12 16:50:39 +0000
committerkargl <kargl@FreeBSD.org>2011-03-12 16:50:39 +0000
commitc519d48b44c3e020735f0ea6ba8990884471b5b2 (patch)
treeeae7ea576c279208da253a26e583fbc1bb847849 /lib/msun/src
parent5d37412b23a8bef61f5bd22635be9554076ef5ed (diff)
downloadFreeBSD-src-c519d48b44c3e020735f0ea6ba8990884471b5b2.zip
FreeBSD-src-c519d48b44c3e020735f0ea6ba8990884471b5b2.tar.gz
Implement the long double version for the cube root function, cbrtl.
The algorithm uses Newton's iterations with a crude estimate of the cube root to converge to a result. Reviewed by: bde Approved by: das
Diffstat (limited to 'lib/msun/src')
-rw-r--r--lib/msun/src/math.h2
-rw-r--r--lib/msun/src/s_cbrt.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/msun/src/math.h b/lib/msun/src/math.h
index 9aa2484..8ad13ed 100644
--- a/lib/msun/src/math.h
+++ b/lib/msun/src/math.h
@@ -411,9 +411,7 @@ long double atan2l(long double, long double);
long double atanhl(long double);
#endif
long double atanl(long double);
-#if 0
long double cbrtl(long double);
-#endif
long double ceill(long double);
long double copysignl(long double, long double) __pure2;
#if 0
diff --git a/lib/msun/src/s_cbrt.c b/lib/msun/src/s_cbrt.c
index 27ecd97..910f75b 100644
--- a/lib/msun/src/s_cbrt.c
+++ b/lib/msun/src/s_cbrt.c
@@ -111,3 +111,7 @@ cbrt(double x)
return(t);
}
+
+#if (LDBL_MANT_DIG == 53)
+__weak_reference(cbrt, cbrtl);
+#endif
OpenPOWER on IntegriCloud