Issue |
80858
|
Summary |
Create bugprone-accuracy-lost-in-floating-point-calculation check
|
Labels |
clang-tidy,
check-request
|
Assignees |
|
Reporter |
PiotrZSL
|
I'm adding this here so, i wouldn't forget.
```
int test(int a)
{
return int((double)a * 0.01); // could be done as a/100;
}
```
Example not the best but, idea is to find all expressions (sometimes multiline) where input is an integer and output is an integer, but calculation is done on floating-point. Sometimes by changing order of operation entire calculation could be done fully on integers.
Check could have also other names.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs