We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24fcc0a commit 03dff0dCopy full SHA for 03dff0d
clang-tools-extra/clang-tidy/altera/UnrollLoopsCheck.cpp
@@ -214,10 +214,12 @@ bool UnrollLoopsCheck::hasLargeNumIterations(const Stmt *Statement,
214
Iterations = ceil(float(InitValue - EndValue) / ConstantValue);
215
break;
216
case (BO_MulAssign):
217
- Iterations = 1 + (log(EndValue) - log(InitValue)) / log(ConstantValue);
+ Iterations = 1 + (log((double)EndValue) - log((double)InitValue)) /
218
+ log((double)ConstantValue);
219
220
case (BO_DivAssign):
- Iterations = 1 + (log(InitValue) - log(EndValue)) / log(ConstantValue);
221
+ Iterations = 1 + (log((double)InitValue) - log((double)EndValue)) /
222
223
224
default:
225
// All other operators are not handled; assume large bounds.
0 commit comments