Open dpgeorge opened 9 months ago
volatile float one = 0;
Is that a bug, or just a typo? :wink:
Is that a bug, or just a typo?
Ooops! That's a typo. I just tested it again with the fixed typo and the output is as in the original post (ie the subnormal bug is there).
Note that the volatile
's are necessary, otherwise the compiler can optimise things away.
It seems that subnormal floats are not handled by the ROM float routines, and the pico-sdk wrappers don't account for this.
Code to reproduce on pico-sdk 1.5.1 (EDIT: fixed typo where it used to say
one = 0
):Output is:
It should be:
Above are just some simple examples, but most other operations on subnormals also return incorrect results (according to IEEE).