]> pd.if.org Git - pdclib/blob - functions/math/sqrt.c
Re-import from Subversion.
[pdclib] / functions / math / sqrt.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 double sqrt( double x ) { /* TODO */ };
9
10 /* Therx code
11 {
12     double i = x / 2;
13     if ( x < 0 )
14     {
15         return 0;
16     }
17     // (15 DP) HOW GET MORE?
18     while ( ( fabs( i - ( x / i ) ) / i ) > 0.000000000000001)
19     {
20         i = ( i + ( x / i ) ) / 2;
21     }
22     return i;
23 }
24 */
25
26 float sqrtf( float x ) { /* TODO */ };
27 long double sqrtl( long double x ) { /* TODO */ };