help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

64 bit problem with bitoperation


From: Patrick
Subject: 64 bit problem with bitoperation
Date: Thu, 02 Aug 2007 16:38:25 +0100
User-agent: Thunderbird 1.5.0.12 (X11/20070529)

Hi

I wanna do a simple xor of two 64 bit variables as in the following code fragment:

  unsigned long long test0 = 0x8888000000001210LL;
  unsigned long long test1 = 0x88111111111100EFLL;
  unsigned long long test2;

  test2 = test0 | test1;

  printf("0x%016x ",test2);

Unfortuantely only the lower 32 bits of the result are correct as the output shows

0x00000000111112ff

Anyone an idea why the higher 32 bits are not affected by the bitoperation? I am using gcc (GCC) 3.4.6.

many thanks!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]