2011-04-21 04:40 AM
How to use floating point with printf
#floating-point---just-say-no! #floating-point---just-say-no!2011-05-17 05:32 AM
Since Floating Point requires very significantly more resources (memory space, execution time, etc) than integer maths - especially on a chip like the STM32 with no hardware FPU - it is often best avoided on (small) microcontrollers.
For this reason, many (most?) embedded toolsets disable floating point by default. Therefore, the first thing you really need to ask yourself is, ''do I really need floating point?''
eg, instead of
float volts;
volts = 1.6483; you could have:
int millivolts;
millivolts = 16483; Otherwise, you are going to have to consult your Raisonance manuals to find out about their support for floating point...2011-05-17 05:32 AM
Floating point also raises a number of issues about precision...
Take a look at, for example: