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
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!
-----------------------------------------------------------------------------------------------------------------------