相关疑难解决方法(0)

cosf(M_PI_2)不返回零

今天早上突然开始.

这是原始的线条

float angle = (x+90)*(M_PI/180.0);
float xx = cosf(angle);
float yy = sinf(angle);
Run Code Online (Sandbox Code Playgroud)

放入断点并悬停光标后..我得到yy的正确答案为1.但xx不为零.

我试着cosf(M_PI_2);仍然没有运气..直到昨天工作正常..我没有改变任何编译器设置等..

我在今天的日期使用Xcode最新版本

c math floating-point

3
推荐指数
3
解决办法
3855
查看次数

标签 统计

c ×1

floating-point ×1

math ×1