fixed #13606/#13607 - consistently print (precise) float as such in ValueFlow debug output#7274
Merged
Merged
Conversation
Collaborator
Author
|
Okay. This appears to be a bit of a mess. #include <iostream>
#include <string>
void print(double d)
{
std::cout << std::to_string(d) << std::endl;
printf("%f\n", d);
std::cout << d << std::endl;
printf("%e\n", d);
printf("%g\n", d);
}
int main()
{
double d = 0.0000001;
print(d);
d = 1 / 0.5;
std::cout << std::endl;
print(d);
}https://godbolt.org/z/PK7MrYqbP
|
--debug ValueFlow output
firewave
force-pushed
the
vfvalue-float
branch
2 times, most recently
from
February 1, 2025 19:22
1d3c4fa to
9c3c9af
Compare
This comment was marked as outdated.
This comment was marked as outdated.
firewave
force-pushed
the
vfvalue-float
branch
from
February 4, 2025 13:49
9c3c9af to
81252fe
Compare
This comment was marked as resolved.
This comment was marked as resolved.
firewave
force-pushed
the
vfvalue-float
branch
2 times, most recently
from
February 6, 2025 01:47
ca7d387 to
1ee82af
Compare
firewave
marked this pull request as ready for review
February 6, 2025 01:48
Collaborator
Author
|
We should probably also add some unit tests testing this. |
firewave
force-pushed
the
vfvalue-float
branch
2 times, most recently
from
February 6, 2025 02:15
789622e to
4e4997c
Compare
danmar
approved these changes
Feb 13, 2025
firewave
force-pushed
the
vfvalue-float
branch
from
February 13, 2025 15:01
4e4997c to
5727559
Compare
firewave
force-pushed
the
vfvalue-float
branch
from
February 13, 2025 15:24
5727559 to
f12a872
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.