AnsweredAssumed Answered

CodeWarrior Version 5.1 and Floating Point Library

Question asked by Hy Mai Employee on Jan 3, 2017
Latest reply on Jan 6, 2017 by ZhangJennie

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

Outcomes