Skip to content
Search

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 int type of 60, so an overflow occurs.

See also

Favorite site

author Zer0 sitemap