Large numbers
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.
August 23, 2001 08:06 AM
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.
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...
Dragonus![](wink.gif)
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
|
Dragonus
![](wink.gif)
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
AP:
I''m making an encryption engine and the very large number is the key.
Dragonus thanks for your post, but as i''m make A LOT of math it is not a very effective way to do it.
I''m making an encryption engine and the very large number is the key.
Dragonus thanks for your post, but as i''m make A LOT of math it is not a very effective way to do it.
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.
If at first you don't succeed, redefine success.
August 23, 2001 12:46 PM
I''ve made some asm code that does the trik. Thanks for your reply python_regious..
August 23, 2001 02:14 PM
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...
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...
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement