As a rule of thumbsthumb, I try to avoid using floating-point in my embedded system codebase.
Floating
Floating-point variables are:
- Computation-intensive
- Not atomic (can cause problems in an RTOS application or with interrupts)
- Their precision can cause non-obvious behaviour (float comparison problem).
But what about a microcontroller with a Floatingfloating point unit (like the STM32F4)?
Do those concerns still apply? Would you still advise against using floating-point?