Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

36 bit Comparison

Status
Not open for further replies.

lecan

Programmer
Joined
Jul 2, 2003
Messages
2
Location
US
Hi to all the GURUS of c++,

I am relatively new to programming in C++. I wanted to compare and shift 36 bit data. I tried to store hex data in a double (64 bit), but would show up differently in the memory, may be because it is interpreting some part as mantissa and other as exponent.

If I use, integer (32 bit) I would have to use 2 of them to store 36 bits. I wanted to know if there is any open library or class in which I can store 36 bits and then shift or compare them.

If not, then Shifting an integer would be a pain, as when shifting left by one bit, the most significant bit is lost, unless stored someplace before shifting. Please advice.

thanks,

lecan
 
Check out the long long or __int64 type in VC++ 7.

Before that you could use a structure (there was one defined in the Windows.h header already) to deal with the two 32-bit chunks.

DJ
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top