Skip to main content
gamedev.net
🔒 Locked

Why are these the same?

Started by Esap1 Sep 16, 2000 at 11:39 PM 7 replies 250+ views
Original Post
Esap1
Esap1
Why are these statements the same, They shouldnt be: __int64 ints,ints1; ints = (80 << 56) | (70 << 48) | (60 << 40) | (50 << 32) | (40 << 24) | (30 << 16) | (20 << 8) | 10; ints1 = (40 << 24) | (30 << 16) | (20 << 8) | 10; if(ints==ints1){WHY ARE THEY THE SAME????} They are the same, why, why would __int64 only hold 32 bits?
Esap1
Esap1
anyone?
Esap1
Esap1
Could someone atleast tell me there not SUPPOSED to be the same?
Metron
Metron
Hi,

this sounds to me as if the == does not a 64 bit compare but only 32 bit. If you look at your line of code, you will see that the lower 32 bit of both __int64 are equal. I couldn''t find the definition of the compare operator... perhaps there isn''t one for 64 bit ?

Kind regards,
Metron
----------------------------------------http://www.sidema.be----------------------------------------
Ysaneya
Ysaneya
I simply guess your compiler takes your integer constants (80,60,40..) as ints (4 bytes) as any other compiler. Just typecast everything to __int64 and i believe it''ll work.

Y.
NBGH
NBGH
Win32 does not support true 64bit data types, they cheat and truncate them to 32bit without you knowing. Trust me, I''ve done a lot of programming with storage media and I know because its a pain in the...
Esap1
Esap1
NBGH: So your saying it will never work?
Esap1
Esap1
Is there any way to get it 2 work?
DLife
DLife
You must cast all calculation operands to __int64.

DLife

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.