variables with a big number of bit and bit operation

N

none

sorry for my bad english.

i'm trying to create variables made by a number of bit rounding about 500
bit, on which i can perform bit operations like & and |.
the problem is that i'm unable to resolve this problem without chunking the
variable in smaller parts, and this is a solution that i wouldn't use.

so everything you can say for helping me is wellcome.

thanks in advance,


--
 
W

Walter Roberson

none said:
i'm trying to create variables made by a number of bit rounding about 500
bit, on which i can perform bit operations like & and |.
the problem is that i'm unable to resolve this problem without chunking the
variable in smaller parts, and this is a solution that i wouldn't use.

If you refuse to chunking of the variable into smaller parts, then
you will need to:

a) find some very specific hardware that supports large bit operations
and code only for that; or

b) use a different programming language which will hide the chunking
from your sight; or

c) give up.


There is nothing you can do in standard C that can extend the
number of bits that the hardware itself can operate on at one time.
If the maximum word size that a particular compiler can use on
a particular machine is 32 bits, then there is not going to be anything
you can do to force the hardware to operate on 33 or 48 or 64 bits.
All you -can- do is write software routines that operate on a chunk
at a time.
 
M

mensanator

none said:
sorry for my bad english.

i'm trying to create variables made by a number of bit rounding about 500
bit, on which i can perform bit operations like & and |.
the problem is that i'm unable to resolve this problem without chunking the
variable in smaller parts, and this is a solution that i wouldn't use.

so everything you can say for helping me is wellcome.

thanks in advance,


--

Try using

GNU MP
The GNU Multiple Precision Arithmetic Library

This will give you bit operations on unlimited precision integers
along with some other interesting functions like scanning for the
least significant 1 or 0 bit, population count (number of 1 bits)
and Hamming distance (count of bit differences).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top