AnsweredAssumed Answered

Float SNAN change to QNAN automaticlly

Question asked by LQ Zhu on Jun 23, 2019
Latest reply on Jun 29, 2019 by Yiping Wang

In my project, I use a MPC8313 and Vxworks. I found that the SNAN will change to QNAN automatically. The demo codes show as below:

void testFloatStart()
{
   float Original;
   *(uint32*) &Original = 0x7f800001; //SNAN
   testFloatNan(Original);
}

void testFloatNan(float temp)
{
   float Target;
   Target = temp;
}

I hope that the 'Target' is 0x7f800001, but it is 0x7fc00001. I test same codes in other processer, such as A9 or M4. They are ok. 

Outcomes