Using SUPER big numbers!

Started by
7 comments, last by SirGorthon 20 years, 11 months ago
Howdy! I need to use numbers beyond the range of unsigned int variables... The numbers I''m working with will all be positive but will be in the area of 5 to 10 times the max value of an unsigned int. How do I go about messing with values that high? Thanks, Gorf
Advertisement
do a google search for "big integers"--that''s the technical term.

How appropriate. You fight like a cow.
You could use Lisp. Lisp handles big numbers transparently and elegantly, by switching representation when the number would overflow.

You could also use java, which has a BigInteger class.

Finally, I believe there is a Gnu numerics library(or something similar to that) which has big integers for c(or maybe c++, never used it).
Just out of curiosity... why do you need such high value numbers?

Could you not use some sort of scaling so that your numbers fall into a more ''friendly'' and generic data type?

Regards,
Sharky


---
#define _WEBSITE
Sharky''s Coding Corner
#endif
---
I did something similar to what your talking about in VB6. I had created my own data type made up of 5 doubles and then made a bunch of functions to make it so that I could use those 5 doubles as one number. I forget the exact range I achieved. It was for a final project.


- Rob Loach
Current Project: Go Through Object-Oriented Programming in C++ by Robert Lafore

"Do or do not. There is no try."
- Yoda
Rob Loach [Website] [Projects] [Contact]
Well... I am in need of calculating pretty big primes...
is this what you need

http://www.swox.com/gmp/#WHAT
ASCII stupid question, get a stupid ANSI
unsigned _int64, or long long, whatever your compiler calls them. 264-1 should be enough ?
unsigned _int64 sounds like it could be useful... Thanks for all the help, ya''ll!

This topic is closed to new replies.

Advertisement