功能:开平方根
头文件:
#include<cmath>
函数声明:
double sqrt (double x);
float sqrt (float x);
long double sqrt (long double x);
double sqrt (T x); // additional overloads for integral types
例子:
/* sqrt example */
#include <stdio.h> /* printf */
#include <math.h> /* sqrt */int main ()
{double param, result;param = 1024.0;result = sqrt (param);printf ("sqrt(%f) = %f\n", param, result );return 0;
}
运行结果: