CodeWarrior Version 5.1 and Floating Point Library

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

CodeWarrior Version 5.1 and Floating Point Library

494 Views
HeMyFAE
NXP Employee
NXP Employee

On of our customer is using CodeWarrior Development Studio for the S12(X) Version 5.1, build 10221. He is testing how the floating point library handles overflow.  If  he multiply 1.8e19 times 1.8e19 it gives him +INF (0x7f800000) which is what he would expect.  If he multiply 3.4e19 time 1.8e19, I get NAN, which he did not expect.  He was expecting +INF.  If he multiply 3.4e19 time 3.4e19  he gets -0 (0x80000000). This one is a problem.  In a control system you never want to get 0 when multiplying two large numbers together.  Do you have any idea how he can trap this overflow so he don’t get 0 for his result?

 

Regards,

hy

Labels (1)
0 Kudos
1 Reply

376 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi hy

Can you please provide a demo project for this problem?

Thanks!


Have a great day,
Jennie Zhang

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos