我__int64
在 64 位 AIX 上使用数据类型,在与 0 进行比较的情况下,我得到了奇怪的结果。
代码片段:
__int64 indexExistingPart = GetValue(); // GetValue always returns -1.
if (indexExistingPart < 0 )
{
DoSomething(); //control never comes to this part of the code
}
我还尝试将 0 分配给另一个__int64
变量并在比较中使用。但是,这也不起作用:
__int64 indexExistingPart = GetValue(); // GetValue always returns -1.
__int64 temp =0;
if (indexExistingPart < temp )
{
DoSomething(); //control never comes to this part of the code
}
为什么比较运算符不适用于 64 位整数?有什么解决方法吗?