Merge pull request #4497 from vadi2/patch-1

Add modern C++ variant
This commit is contained in:
Geoffrey White
2020-10-19 19:09:23 +01:00
committed by GitHub

View File

@@ -4,3 +4,5 @@ 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 l = static_cast<long>(i) * i; //Correct: modern C++