要在C语言中引入math库,需要在代码中包含以下语句:
#include <math.h>
这样就可以使用math库中定义的数学函数了。例如,可以使用sqrt函数来计算一个数的平方根:
#include <stdio.h>
#include <math.h>
int main() {
double num = 16.0;
double result = sqrt(num);
printf("The square root of %f is %f\n", num, result);
return 0;
}