-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Replacing snprintf-based hex float formatter with internal implementation #3179
Conversation
phprus
commented
Nov 13, 2022
- Replacing snprintf-based hex float formatter with internal implementation.
- Add missing env CTEST_OUTPUT_ON_FAILURE.
- Enable C++17 tests on macOS for simplify hex float tests.
Benchmark: MacbookPro M1 Max:
|
7bdac5c
to
8dbd9fd
Compare
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.
Thanks for the PR! Overall looks great, a few minor comments inline. Also please move the build config changes into a separate PR.
@vitaut, Rebased. |
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
Rebased onto master |
|
||
constexpr auto leading_shift = ((num_xdigits - 1) * 4); | ||
const auto leading_mask = carrier_uint(0xF) << leading_shift; | ||
const auto leading_v = |
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.
What does "v" stand for?
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.
"value".
But, probably, it would be more correct name: "leading_[hex]digit" or "most_significant_[hex]digit".
Now I think leading_*
are not good names.
Make a PR with renaming? If yes, which option should I choose?
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.
A PR sounds good. I think leading_hexdigit or leading_xdigit (for consistency with num_xdigits) is fine. most_significant_* might be more precise but longer and I think leading is clear enough.
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.
Done: PR #3203
Merged, thanks! |