Why float data type is not accurate on a STM32?
Floating point numbers are represented as a sum of binary fractions times a power of two. In single-precision IEEE-754 floating point numbers, the fractions range from \$1/{2^0}\$ to \$1/2^{23}\$ and the powers of two range from \$2^{-126}\$ to \$2^{127}\$. For example:

$$12 = \left(\frac 1 1 + \frac 1 2\right) \cdot 2^3 = 1.5 \cdot 8 = 12$$
$$0.5 = \left(\frac 1 1\right) \cdot 2^{-1} = 1 \cdot \frac 1 2 = 0.5$$
$$12.5 = \left(\frac 1 1 + \frac 1 2 + \frac 1 {16}\right) \cdot 2^3 = 1.5625 \cdot 8 = 12.5$$
$$62 = \left(\frac 1 1 + \frac 1 2 + \frac 1 4 + \frac 1 8 + \frac 1 {16}\right) \cdot 2^5 = 1.9375 \cdot 32 = 62$$

But 0.06 and 0.8 cannot be evenly represented in this way, just as \$1/3\$ cannot be represented as a sum of decimal fractions:

$$\frac 1 3 \approx \left(\frac 3 {10} + \frac 3 {100} + \frac 3 {1000} + \frac 3 {10000} + \cdots \right) \approx 0.33333\dots$$

$$0.06 \approx \left(\frac 1 1 + \frac 1 2 + \frac 1 4 + \frac 1 8 + \frac 1 {32} + \frac 1 {128} + \frac 1 {256} + \frac 1 {512} + \frac 1 {16384} + \frac 1 {65536} + \frac 1 {1048576} + \frac 1 {2097152} + \frac 1 {4194304} +  \frac 1 {8388608}\right) \cdot 2^{-5} \approx 1.91999995708465576171875 \cdot \frac 1 {32} \approx 0.0599999986588954925537109375$$

The decimal representations may vary from system to system. I'm not going to spend a lot of time writing out more examples, because hopefully you get the idea by now. The important thing is that floating point numbers are binary rational numbers, even though you put decimal rational numbers into your source code!

Floating point numbers are intended to be approximate. If you need to represent exact values, use integers or another alternative. If you don't know whether you need floating point, you probably don't.

For more information, I've found the Floating Point Guide to be easier to read than Goldberg's essay, but both are valuable.