sqrt

Computes the non-negative square root of the specified argument

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:Mathematical Computation

Syntax

  #include <math.h>  
   
  double sqrt  (  
     double   x);
  

Parameters

x
(IN) Specifies the argument for which the nonnegative square root is to be computed.

Return Values

The sqrt function returns the value of the square root. When the argument is outside the permissible range, errno is set and matherr is called. Unless the function is replaced, matherr prints a diagnostic message using the stderr stream.

Remarks

The sqrt function computes the nonnegative square root of x. A domain error occurs if the argument is negative.

See Also

exp, log, matherr, pow

Example

  #include <math.h>  
  #include <stdio.h>  
   
  main ()  
  {  
     printf ("%f\n", sqrt (.5) );  
  }
  

produces the following:

  0.707107