|
sin(x)结果不正确的已经解决!原因是需要在代码中事先声明一下:
声明前如下:
Action()
{
double latitude=48.0;
double lat_rad=(latitude/180)*3.14159;
double sinn=sin(lat_rad);
lr_message("latitude is :%f",latitude);
lr_message("lat_rad is :%f",lat_rad);
lr_message("sin(lat_rad) is :%f",sinn);
return 0;
}
这样是得不出正确结果的,应该如下:
Action()
{
double sin(double x);
double latitude=48.0;
double lat_rad=(latitude/180)*3.14159;
double sinn=sin(lat_rad);
lr_message("latitude is :%f",latitude);
lr_message("lat_rad is :%f",lat_rad);
lr_message("sin(lat_rad) is :%f",sinn);
return 0;
} |
|