Loading...
Select Version
&pagelevel(4)&pagelevel
Definition | #include <math.h> double sqrt(double x); These functions calculate the square root of a non-negative floating-point number x. | |
Return val. |
| if x is >= 0. |
0 | if x is negative. In addition, | |
Example | The following program calculates the square root of an input value x. #include <math.h> #include <stdio.h> int main(void) { double x; scanf("%lf", &x); printf("Square root of %g : %g\n", x, sqrt(x)); printf("%d\n", errno); return 0; } | |
See also | exp, pow, log, log10, hypot, sinh |