X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fmath%2Fcbrt.c;h=64185aa037036737f3ea66b7838fec76044ff2fb;hb=e081ed1387e0c27dc689c8e32fdda06039544107;hp=cf6d16b8a0376ed73c0fa06c8f7891dbb00a6017;hpb=34893ecc2200dc7017c36a54cb6c5f4c2378b5ec;p=pdclib diff --git a/functions/math/cbrt.c b/functions/math/cbrt.c index cf6d16b..64185aa 100644 --- a/functions/math/cbrt.c +++ b/functions/math/cbrt.c @@ -5,15 +5,19 @@ // This code is Public Domain. Use, modify, and redistribute at will. // ---------------------------------------------------------------------------- -// ---------------------------------------------------------------------------- -// C++ +double cbrt( double x ) { /* TODO */ }; -float cbrt( float x ) { /* TODO */ }; -long double cbrt( long double x ) { /* TODO */ }; +/* 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; +} +*/ -// ---------------------------------------------------------------------------- -// Standard C - -double cbrt( double x ) { /* TODO */ }; float cbrtf( float x ) { /* TODO */ }; long double cbrtl( long double x ) { /* TODO */ };