Update cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.cpp

Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
This commit is contained in:
Vadim Peretokin
2020-10-19 12:49:32 +02:00
committed by GitHub
parent 8933bbd672
commit f403c9d02c

View File

@@ -5,4 +5,4 @@ long j = i * i; //Wrong: due to overflow on the multiplication between ints,
long k = (long) i * i; //Correct: the multiplication is done on longs instead of ints,
//and will not overflow
long k = static_cast<long>(i * i); //Correct: modern C++
long l = static_cast<long>(i * i); //Correct: modern C++