Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aa578ed

Browse files
vadi2geoffw0
andauthored
Update cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.cpp
Co-authored-by: Geoffrey White <[email protected]>
1 parent f403c9d commit aa578ed

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ long j = i * i; //Wrong: due to overflow on the multiplication between ints,
55
long k = (long) i * i; //Correct: the multiplication is done on longs instead of ints,
66
//and will not overflow
77

8-
long l = static_cast<long>(i * i); //Correct: modern C++
8+
long l = static_cast<long>(i) * i; //Correct: modern C++

0 commit comments

Comments
 (0)