I am using a PLC that use a STM32F4 as its processor. The PLC software has Integer and Float calculation commands. When I working with floating point numbers usually trying to use integer calculations and result is divide by 1000 and get final result. I think this method saves program execution time and will be able to get faster cycle time in PLC program.
Ex: If I want to multiply a value (x) in from constant (1.234567),
- Multiply x by 1234567
- divide the result by 1000000
- get final result
But, STM32F4 has hardware floating point unit (FPU). So, I have a problem using above method actually make program faster.
Is my integer calculation method will actually saves program execution time than floting point calculation method?