Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.
How do I make a variable with contains 100-200 numbers (not a array) without making inline asm. An eksamble
20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Sorry for my bad english.
Well, this is more of a data structures question than a math question. To tell you the best way, we''d have to know what you are using such large numbers for. Are you mostly multiplying or adding? etc...
You will have to use either a struct or an array to store anything that big. Not necessarily an array entry per digit, though.
The cheap way to do it is to create a class that contains several "long" values, and then you override all the operations of +, -, *, /, etc. Of course, the specifics of how you do it will depend upon your usage of it, but here''s an idea...
class bigint { private: // As the value of binary bits are 2^0, 2^1, 2^2...
long long1; // value = n^0, where you pick the n
long long2; // value = n^1
long long3; // value = n^2
// .
// .
// .
long longI; // value = n^i, where n^(i + 1) > biggest number you hope to make
Dragonus Thought of the Moment "If success is A, then the equation is A = X + Y + Z, where X is work, Y is play, and Z is keep your mouth shut!" ~ Albert Einstein
Using asm for direct access to the memory, or dragnuses way are the only two methods that I can think of. Oh, thinking about it a bit more, perhaps you could use a type of floating point method? Maybe you could have a 128bit mantissa, with a 16bit exponent. That would produce extreamly large numbers. The extended precision floating point numbers all ready implimented in the pentium FPU''s ( 80bit )can go up to very large numbers ( gugol upwards ), so you may want to try them.
Public key encryption, right? (RSA /is/ out of patent protection now...)
Dragonus''s suggestion would work fine for a bit reordering scheme such as DES or Triple DES. But then, you''d just search out and download the freely available and cryptographically proven blowfish algo''s source if that''s what you wanted...
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.