1 2 Previous Next 16 Replies Latest reply on Oct 24, 2016 2:58 AM by user_1377889

    PSoC calculation returns nan(0x8000000000000). What means nan? pleas Help me

    robertniyo5_1529256

      #include <project.h>
      #include <ADXL345.h>
      #include "math.h"

         

      int main()
      {
          int  st_speed=30; // m/s
           int x_axis = 10; // in  meter
          
          float g = 9.807; // in  m/s^2
         

         

      void ADXL_Init();
          CyGlobalIntEnable; /* Enable global interrupts. */
        I2C_ADXL_Start(); 

         

       

         

      calc_Angle_x = (1/2*asin(x_axis*g/st_speed*st_speed))*((180.0)/3.14);

         

      for(;;)
          {   

         

      why does calc_Angle_x return nan(0x8000000000000) and what nan means?

         

      It supposed to return 3.129462438 degree

        1 2 Previous Next