Very Long Integers
-
i need a way to deal with a number that is 320 digits long. Whats more, it needs to be an integer, not a decimal. how would i go about working with such large numbers, dividing, adding subtracting, etc. I have tried Long, Decimal and Double but none of them are long enough.
Posted by The ANZAC
-
i need a way to deal with a number that is 320 digits long. Whats more, it needs to be an integer, not a decimal. how would i go about working with such large numbers, dividing, adding subtracting, etc. I have tried Long, Decimal and Double but none of them are long enough.
Posted by The ANZAC
There is no type that handles numbers remotely that long. You'd have to write your own class, to handle a type like this, or look for one online. Do you need all 320 digits to be accurate ? If you only need accuracy to a certain number of digits, you can always assume the rest are 0s.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
i need a way to deal with a number that is 320 digits long. Whats more, it needs to be an integer, not a decimal. how would i go about working with such large numbers, dividing, adding subtracting, etc. I have tried Long, Decimal and Double but none of them are long enough.
Posted by The ANZAC
Karens Power Tools has a free calculator with source code that handles numbers with thousands of digits http://www.karenware.com/powertools/ptcalc.asp