]> pd.if.org Git - pdclib/blob - functions/math/cbrt.c
Merged PDPCLIB and Therx code.
[pdclib] / functions / math / cbrt.c
1 // ----------------------------------------------------------------------------
2 // $Id$
3 // ----------------------------------------------------------------------------
4 // Public Domain C Library - http://pdclib.sourceforge.net
5 // This code is Public Domain. Use, modify, and redistribute at will.
6 // ----------------------------------------------------------------------------
7
8 // ----------------------------------------------------------------------------
9 // C++
10
11 float cbrt( float x ) { /* TODO */ };
12 long double cbrt( long double x ) { /* TODO */ };
13
14 // ----------------------------------------------------------------------------
15 // Standard C
16
17 double cbrt( double x ) { /* TODO */ };
18
19 /* Therx code
20 {
21     double i = x / 4;
22     // (15 DP) HOW GET MORE?
23     while ( ( fabs( i - ( x / i / i ) ) / i ) > 0.00000000000001 )
24     {
25         i = ( i + ( x / i / i ) + i ) / 3;
26     }
27     return i;
28 }
29 */
30
31 float cbrtf( float x ) { /* TODO */ };
32 long double cbrtl( long double x ) { /* TODO */ };