This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

调用cos程序跑飞



大家好

         在simulator下,main里面有调用了我写的一个函数,但是程序运行到cos这个函数的时候,程序会一直死在里面不出来,这是什么原因?有的时候工程可以出现正常的结果,运行OK ,但是有的时候工程出的结果就不正确。不是死在cos里面,就是求得的cos值不正确。我在程序里有#include<math.h>, 请问这个是什么原因?请高手解答,谢谢!

  • 我在一个简单的hello 程序在按如下测试调用没有问题,你试试看这样有问题么。

    #include <math.h>

    /*
     * hello.c
     */
    int main(void) {
     double b, a=12;
     int coreId = DNUM;

     printf("hello world from core %d\n", coreId);

     b = cos(a);
      return 0;