clang-tools 22.0.0git
|
Checks the usage of patterns known to produce incorrect rounding. More...
#include <IncorrectRoundingsCheck.h>
Public Member Functions | |
IncorrectRoundingsCheck (StringRef Name, ClangTidyContext *Context) | |
void | registerMatchers (ast_matchers::MatchFinder *Finder) override |
void | check (const ast_matchers::MatchFinder::MatchResult &Result) override |
Checks the usage of patterns known to produce incorrect rounding.
Programmers often use (int)(double_expression + 0.5) to round the double expression to an integer. The problem with this
Definition at line 24 of file IncorrectRoundingsCheck.h.
|
inline |
Definition at line 26 of file IncorrectRoundingsCheck.h.
|
override |
Definition at line 47 of file IncorrectRoundingsCheck.cpp.
|
override |
Definition at line 27 of file IncorrectRoundingsCheck.cpp.