Float SNAN change to QNAN automaticlly

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Float SNAN change to QNAN automaticlly

636 Views
lqzhu
Contributor I

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. 

Tags (4)
0 Kudos
Reply
1 Reply

581 Views
yipingwang
NXP TechSupport
NXP TechSupport

Dear LQ Zhu,

.

Probably this problem is caused by the compiler provided in Vxworks.

After testing this program on MPC8313RDB with CodeWarrior 8.8, the result is as the following.
Original Value: 7f800001
Target Value: 7f800001

Thanks,

Yiping

0 Kudos
Reply