Hi,
Im triying to make a divide algorithm, using 64 bit reminder, i want to split an 64 bit integer from last 32 bits.
Ex: my number is 64 bit 10000.........000000 and iwant to use only first 32 bits.
Thanks
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
nailPosted Apr 16, 2009, 12:54 PM
Ex: mynumber is 1111 1111 and iwant to replace last 4 bits with 0011 and get 0011 1111
how can i do it with bitwise operators?
tim dinhPosted Apr 15, 2009, 7:24 PM
long yourNumber = 10000;
long first32Bits = yourNumber >> 32;