nxp-mcuxpresso / mcux-sdk

MCUXpresso SDK
BSD 3-Clause "New" or "Revised" License
301 stars 136 forks source link

Replaced floating point comparison with integer one. #62

Closed EmergReanimator closed 2 years ago

EmergReanimator commented 2 years ago

Signed-off-by: Alexander Goomenyuk emerg.reanimator@gmail.com

Prerequisites

Describe the pull request

Comparing a float number with == and != operators is not safe. See https://embeddeduse.com/2019/08/26/qt-compare-two-floats/ for more details. It is safer to cast the result to integer time to perform comparison.

Tests

mcuxsusan commented 2 years ago

Thanks for your contribution, appreciate for your such detailed information and checks you executed. Our developer will check the change and provide feedback later.

mcuxsusan commented 2 years ago

Appreciate for your patience, PR is merged.