【发布时间】:2012-11-23 10:16:47
【问题描述】:
int left = std::numeric_limits<int>::min();
int right = -1;
//the code below instead of give one more than int_max gives: 18446744071562067968
unsigned long long result = left * right;
我尝试查找 UAC,但即使根据 UAC 规则,这也应该产生正确的输出。任何想法为什么结果不正确?
【问题讨论】:
标签: c++ integer type-conversion uac