docs: non standard behaviour of float()
See
https://github.com/micropython/micropython/issues/11735
The official page
https://docs.micropython.org/en/latest/genrst/builtin_types.html#float
should be updated about the different result of
float('_')
(and eventually other invalid inputs)
between Python and MicroPython.
Floating-point behavior is not consistent with IEEE754
For some reason, even the most simple floating-point operations yields results that don't match IEEE754. For instance, in uPy, 0.1+0.2 == 0.3 returns True, while it is False in CPython and every other programming language that uses IEEE754.
One might argue that uPy's behavior is better. In that case it might, but uPy also does some rounding errors, just not the same as everyone else… For example, 1000.4-1000 will yield 0.4000244 in uPy but 0.39999999999997726 in CPython, JavaScript (Chrome, Firefox), Ruby, etc…
Also it looks like uPy's behavior is not matching the Python standard, since https://docs.python.org/3/tutorial/floatingpoint.html explicitly says that 0.1+0.2 == 0.3 should return False.
This bug is reproducible on the uPy live web page.