We are using Kinetis design studio version 3.2 for our application. In this IDE we are facing a problem with "roundf" of math library function.(explained in below)
float val = 14.98967;
float C_val = 0;
C_val = roundf(val*100)/100; // Round off the value with two decimal places
the result for the above function in Code warrior is C_Val = 14.9900
But in KDS : C_Val = 14.9899998;
Is there any other method in KDS to get the value same as in Code warrior ?
Please suggest...
Regards
Dhanalakshmi
Hello Sreerama Dhanalakshmi ,
I test on KDSv3.2 with FRDM-K64 board, the data also 14.9900 :
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------