Using SUPER big numbers!
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
do a google search for "big integers"--that''s the technical term.
How appropriate. You fight like a cow.
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).
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
---
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
Current Project: Go Through Object-Oriented Programming in C++ by Robert Lafore
"Do or do not. There is no try."
- Yoda
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement