-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix rounding bug when formatting floats with minimal_printf #15152
Fix rounding bug when formatting floats with minimal_printf #15152
Conversation
@sytsereitsma, thank you for your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please amend the commit message for 6d58014 (it should explain how is it fixing the bug)
@sytsereitsma Thank you for contributing to Mbed OS. I've noticed you added also unit tests, great ! I left a git request above, please review |
6d58014
to
46273aa
Compare
I enabled to run basic checks (I expect style check to fail, few offenders there, please review once completed). |
And added a bonus test for string padding
46273aa
to
bfce7fd
Compare
When decimal_prec is 0 and the value is negative and needs rounding subtract 1, instead of adding 1 When decimal_prec > 0 round before printing the integer part, instead of after
bfce7fd
to
43f0c14
Compare
Jenkins CI Test : ✔️ SUCCESSBuild Number: 2 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Summary of changes
Fixed error in floating point rounding in minimal_printf implementation:
Added unit tests for floating point rounding and string padding (aka prepending) in minimal_printf.
Impact of changes
Migration actions required
Documentation
None
Pull request type
Test results
Reviewers