Improving REPR_C float accuracy #17566
Unanswered
yoctopuce
asked this question in
Core Development
Replies: 1 comment 4 replies
-
IMHO, loosing two bits on smallints is a major problem. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have made a few experiments to check how we could improve the accuracy of
REPR_C
, which currently drops the two lowest mantissa bits.I came out with the solution below, simpler than current 32bit nanboxed version:
The resulting code size on ARM4F architecture currently appears to be 600 bytes smaller than current
REPR_C
, and we get one more mantissa bit on floats. The trade-off is that we loose two bits of immediate smallints, there are still enough to represent a millisecondticks_diff
covering several days.I would think this is worth running more tests, what do you think ?
Should I try to submit a pull request amending
REPR_C
? Or make a newREPR_E
?Beta Was this translation helpful? Give feedback.
All reactions