Author: Eugene Nalimov
Date: 00:07:32 07/25/04
Go up one level in this thread
On July 25, 2004 at 02:22:26, Omid David Tabibi wrote:
>[...]
>
>In MSVC the problem is worse: if you don't mention UI64 it will do some stupid
>things, and it won't even warn!
>
>For example:
>
>UINT64 num = 9837343779575477641;
>
>num is not equal to 9837343779575477641, as the latter is treated a 32 bit
>number, if not specified otherwise.
>
>[...]
C:\Temp>type s.c
#include <stdio.h>
int main ()
{
unsigned __int64 x;
x = 9837343779575477641;
printf ("%I64u\n", x);
if (x == 9837343779575477641)
printf ("Eq\n");
else
printf ("Ne\n");
return 0;
}
C:\Temp>cl s.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.00.9466 for 80x86
Copyright (C) Microsoft Corporation 1984-2001. All rights reserved.
s.c
Microsoft (R) Incremental Linker Version 7.00.9466
Copyright (C) Microsoft Corporation. All rights reserved.
/out:s.exe
s.obj
C:\Temp>s.exe
9837343779575477641
Eq
Thanks,
Eugene
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.