C++:OrderOfEvaluation
lastmod 2020-05-17created 2020-05-171 edits
Casting and order of evaluation
1llu*60*60*1000*1000 and 60*60*1000*1000*1llu give different results.
- In the former, the computation starts as
unsigned long long, so the value is computed correctly. - The latter is computed in the
inttype of60, so an overflow occurs.