Ftoa shift math #323
stefano-zanotti-88
started this conversation in
General
Replies: 0 comments
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.
Uh oh!
There was an error while loading. Please reload this page.
-
These calculations:
nanoprintf/nanoprintf.h
Lines 657 to 670 in f0687bc
Why are those there, instead of the following ones?
The current ones seem always ok, as long as both sizes are powers of 2, but also needlessly cryptic.
The simplified ones are perfectly fine, as far as I can tell.
Edit: I see that my code causes a "right shift by negative amount" in the first
carry
assignment, iffNPF_DOUBLE_BIN_BITS == NPF_FTOA_MAN_BITS
. This is not a problem in itself, since that branch is not taken in this case; but maybe this can trigger UB and screw the whole function.The
man_f
assignments seem always ok, though.Beta Was this translation helpful? Give feedback.
All reactions