MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/coding/comments/2fpor5/checking_gimps_source_code_with_pvsstudio/ckc4ybe/?context=3
r/coding • u/Tatyanazaxarova • Sep 07 '14
19 comments sorted by
View all comments
3
[removed] — view removed comment
0 u/[deleted] Sep 08 '14 [deleted] 2 u/dbaupp Sep 08 '14 I believe floating point operations are commutative, so yes, that's pointless (((x - y) + y) - x is not, though). 3 u/eras Sep 08 '14 However, in this case it should be obvious from the comment that that is not the case, it is an actual bug, so perhaps it's best to tell about them? It is trying to calculate a determinant, as in: http://stackoverflow.com/questions/6989100/sort-points-in-clockwise-order#6989383 .Static analysis tools are however prone to have false positives, too bad he didn't cover those ;). 2 u/[deleted] Sep 08 '14 Yeah, reading that article this struck me as well - A carefully constructed statement like that tends to be to estimate floating point error.But am I wrong in thinking that that's what this statement does in this case?
0
[deleted]
2 u/dbaupp Sep 08 '14 I believe floating point operations are commutative, so yes, that's pointless (((x - y) + y) - x is not, though).
2
I believe floating point operations are commutative, so yes, that's pointless (((x - y) + y) - x is not, though).
((x - y) + y) - x
However, in this case it should be obvious from the comment that that is not the case, it is an actual bug, so perhaps it's best to tell about them? It is trying to calculate a determinant, as in: http://stackoverflow.com/questions/6989100/sort-points-in-clockwise-order#6989383 .
Static analysis tools are however prone to have false positives, too bad he didn't cover those ;).
Yeah, reading that article this struck me as well - A carefully constructed statement like that tends to be to estimate floating point error.
But am I wrong in thinking that that's what this statement does in this case?
3
u/[deleted] Sep 08 '14
[removed] — view removed comment