Conversation
816dfba to
784b8e8
Compare
Dudeldu
reviewed
Jun 9, 2022
Owner
Dudeldu
left a comment
There was a problem hiding this comment.
I really like the warning showing exactly where you lost the "exactness".
| int check2 = (x == y); // WARN | ||
|
|
||
| // The following is __DBL_MAX__ | ||
| double my_max = 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.000000; |
Owner
There was a problem hiding this comment.
Add the header float.h, so you can use DBL_MAX instead of this interesting number
Collaborator
There was a problem hiding this comment.
I guess this is the same issue i had with DBL_MIN ? #13 (comment)
Owner
There was a problem hiding this comment.
Right, I also added the DBL_MAX case to my fix
Owner
There was a problem hiding this comment.
With #10 merged, we should now be able to use DBL_MAX constant.
acf0cd3 to
2318f94
Compare
FelixKrayer
previously approved these changes
Jun 15, 2022
Owner
|
Why are the regression tests still failing? Seems like there is no warning generated for the first comparison. |
…but are not exact anymore after
…dd warning for not equal
2318f94 to
ea0b433
Compare
Dudeldu
approved these changes
Jun 16, 2022
brgr
added a commit
that referenced
this pull request
Jun 16, 2022
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.
First is CWE 1077
For the second point I have found these that fit: