This is an archive of the discontinued LLVM Phabricator instance.

[libc] Fix printf %f rounding condition
ClosedPublic

Authored by michaelrj on Feb 28 2023, 3:15 PM.

Details

Summary

When running the tbin2dec tests I found a rounding error in my code.
Upon inspection I realized it was due to a lack of parenthesis when
calculating the number of trailing digits. This patch fixes that mistake
and adds unit tests to catch regressions in future.

Diff Detail

Event Timeline

michaelrj created this revision.Feb 28 2023, 3:15 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 28 2023, 3:15 PM
michaelrj requested review of this revision.Feb 28 2023, 3:15 PM
lntue accepted this revision.Feb 28 2023, 4:36 PM
This revision is now accepted and ready to land.Feb 28 2023, 4:36 PM
This revision was automatically updated to reflect the committed changes.