I used to think that floating-point was not for Embedded Systems. Too slow, too much code overhead and rounding is always a problem.
It turns out that while scaled integers still have a performance benefit, floating-point computations can be done with a surprisingly high performance these days on modern Embedded CPUs. This is true not only for CPUs with floating-point unit (FPU), such as the Cortex-M4F, but also for CPUs which have to do this in software, such as a regular Cortex-M3 or M4 without FPU.
But first things first, let’s look at how things work: