J
Justin Shen
the output of the following codes is "greater than zero", which is rather
strange! the correct one should be "not greater than zero"
int a = 0x79de61c0; //2044617152;
a += 0x12345678;
//a is 0x8c12b838 //-1944930248
if (a > 0)
{
Console.WriteLine("greater than zero");
}
else
{
Console.WriteLine("not greater than zero");
}
string str1 = a.ToString();
but if you comment out the "string str1 = a.ToString();",than the output is
correct:
int a = 0x79de61c0; //2044617152;
a += 0x12345678;
//a should be 0x8c12b838; //-1944930248
if (a > 0)
{
Console.WriteLine("greater than zero");
}
else
{
Console.WriteLine("not greater than zero"); //output is "not greater
than zero" now
}
anyone have any idea of this? The problem occurs in both VS2003 and VS2005 .
Is this a bug of JIT compiler?
strange! the correct one should be "not greater than zero"
int a = 0x79de61c0; //2044617152;
a += 0x12345678;
//a is 0x8c12b838 //-1944930248
if (a > 0)
{
Console.WriteLine("greater than zero");
}
else
{
Console.WriteLine("not greater than zero");
}
string str1 = a.ToString();
but if you comment out the "string str1 = a.ToString();",than the output is
correct:
int a = 0x79de61c0; //2044617152;
a += 0x12345678;
//a should be 0x8c12b838; //-1944930248
if (a > 0)
{
Console.WriteLine("greater than zero");
}
else
{
Console.WriteLine("not greater than zero"); //output is "not greater
than zero" now
}
anyone have any idea of this? The problem occurs in both VS2003 and VS2005 .
Is this a bug of JIT compiler?