Guardian C Library Calls Reference Manual

sqrt
3-170 128833Guardian TNS C Library Calls Reference Manual
Reference to Library Calls
sqrt
The sqrt function computes the square root of its argument.
expr
is an expression of type double with a positive value.
Return Value
is the square root of expr. If expr is negative, sqrt returns zero and sets errno to
EDOM (a domain error).
Example
This example prints “The square root of 25.000000 is 5.000000.”:
#include <stdioh>
#include <mathh>
int main(void)
{
double r;
double x;
x=25.0;
r = sqrt(x);
printf ("The square root of %f is %f.", x, r);
}
#include <mathh>
double sqrt(double expr);