Bigint lib (up to 300^60000) I need a library or some math intro how to handle integers up to 300^60000. Any idea?
na
One possibility is the GNU MP library (http://www.swox.com/gmp/).
Roel Schroeven
Problem with most large number (large integer big integer) libraries is that they don't have a ActiveX wrapper around them. .Net SDK and Java both have large number libraries.
Li-fan Chen
No matter how smart your bigint library is, you just cannot
S.C.
cool, seems to work fine.
na
s.c.
na
If you want ot represent it in chars, why do you want a big int library? I know, I know, in C char and int can be equivalent. Maybe instead of a big int library you could just write the chars in a large font?
You cannot represent 10^80 different values without having at least as many bits to store a value in. Assuming that you need one atom per bit, etc...
Frederik Slijkerman
Common Lisp has this built in. You could use Allegro ( http://www.franz.com/products/ ) but there are easier solutions.
Just me (Sir to you)
na: Representing the number "10^80" and representing 10^80 different values are very different things. As you said you can represent the number in 5 characters, but to represent that many different values you need far more information.
Mike McNertney
Frederik, I think your math is not quite right. The number of bits required to store any integer from 0 to n is the base-2 log of n.
Eric Lippert
Furthermore, even without the conversion to binary, it is pretty silly to claim that you can't represent 10^80 different values, considering you can do so with an 80 character string of digits. ;)
Mike McNertney
Jinx.
Eric Lippert
To clear up the "number of atoms in the universe" thing:
Gareth McCaughan
Ahem. I'd like to mention that the last 5 replies
Gareth McCaughan
SC & Frederick,
Dennis Atkins
Please pardon me if this is ignorant, I'm just a student at University, but doesn't bigint storage in actuallity require far more than log2(n) bits in actuallity?
Andrew Murray
Well to be sure you need some overhead, but you could also do it array style: one int which tells us the length of the array, and then an array of bytes, with the last byte 0 padded as necessary. Interpret this as a number by appending them (in whichever endianness makes you happy).
Steven C.
Steven,
Andrew Murray
You guys are right. I guess I was thinking about certain particular problems when I made that stupid mistake.
S.C.
Apologies for the stupid mistake... :-)
Frederik Slijkerman
>Apologies for the stupid mistake... :-)
Pietro
Andrew: If the length of the number won't fit into
Gareth McCaughan
Gareth,
Andrew Murray
Sorry for the formatting of the previous post, I'm repairing my maching and posting through lynx, which is kind of a b*tch.
Andrew Murray
Fog Creek Home |