sqrt
double  sqrt ( double x );
math.h
  cplusplus.com  

Calculate square root.
  Returns the square root of parameter x.

Parameters.

x
Non-negative floating point value.

Return Value.
  Square root of x.

Portability.
  Defined in ANSI-C.
  ANSI-C++ adds float and double overloaded versions of this function, with the same bahavior but being both, parameter and result, of one of these types.

Example.

/* sqrt example */
#include <stdio.h>
#include <math.h>

main ()
{
  double param, result;
  param = 1024.0;
  result = sqrt (param);
  printf ("sqrt(%lf) = %lf\n", param, result );
  return 0;
}
Output:
sqrt(1024.000000) = 32.000000

See also.
  exp, log, log10, pow


© The C++ Resources Network, 2000