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.
esp32: `misc/rge_sm.py` test fails with hardware floating point enabled.
Port, board and/or hardware
generic esp32 board with ESP32_GENERIC
MicroPython version
MicroPython v1.26.0-preview.148.g49f81d504.dirty on 2025-05-25; Generic ESP32 module with ESP32
Reproduction
- Build the current
master(49f81d5046aaeb31f90626426363ae2518dbd810) ESP32 port with hard floating point support enabled (forceMICROPY_OBJ_REPRset toMICROPY_OBJ_REPR_CandMICROPY_FLOAT_IMPLset toMICROPY_FLOAT_IMPL_FLOAT) - Flash the firmware on the board and run the test suite
misc/rge_smtest will fail.
Expected behaviour
tests/misc/rge_sm.py should not fail with hard floating point support enabled.
Observed behaviour
The test output is attached:
Additional Information
Maybe the test should be rewritten using unittest.assertAlmostEqual to perform the value comparisons instead of relying on rounding behaviour.
I'm aware I'm trying out an uncommon object representation for the target in question, but I wonder if other MCUs with hardware floating point also exhibit the same test failure since the test relies on how float rounding is performed to pass.
Code of Conduct
Yes, I agree