]> pd.if.org Git - pdclib/blobdiff - functions/math/cbrt.c
Re-import from Subversion.
[pdclib] / functions / math / cbrt.c
index cf6d16b8a0376ed73c0fa06c8f7891dbb00a6017..12fc59e3c4493cf93e2f8db44636ed06817d95a1 100644 (file)
@@ -1,19 +1,23 @@
-// ----------------------------------------------------------------------------
-// $Id$
-// ----------------------------------------------------------------------------
-// Public Domain C Library - http://pdclib.sourceforge.net
-// This code is Public Domain. Use, modify, and redistribute at will.
-// ----------------------------------------------------------------------------
+/* ----------------------------------------------------------------------------
+ * $Id$
+ * ----------------------------------------------------------------------------
+ * Public Domain C Library - http://pdclib.sourceforge.net
+ * This code is Public Domain. Use, modify, and redistribute at will.
+ * --------------------------------------------------------------------------*/
 
-// ----------------------------------------------------------------------------
-// C++
-
-float cbrt( float x ) { /* TODO */ };
-long double cbrt( long double x ) { /* TODO */ };
+double cbrt( double x ) { /* TODO */ };
 
-// ----------------------------------------------------------------------------
-// Standard C
+/* Therx code
+{
+    double i = x / 4;
+    // (15 DP) HOW GET MORE?
+    while ( ( fabs( i - ( x / i / i ) ) / i ) > 0.00000000000001 )
+    {
+        i = ( i + ( x / i / i ) + i ) / 3;
+    }
+    return i;
+}
+*/
 
-double cbrt( double x ) { /* TODO */ };
 float cbrtf( float x ) { /* TODO */ };
 long double cbrtl( long double x ) { /* TODO */ };