它给出的值是 557135813.94455。每次值都会保持不变吗?为什么它不显示无穷大?
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
int main ()
{
double param, result;
param = 90.0;
result = tan ( param * PI / 180.0 );
printf ("The tangent of %f degrees is %f.\n", param, result );
return 0;
}
您没有传递 Pi/2 的值,而是传递 90.0 * 3.14159265 / 180.0,一个近似值。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)