[fpc-pascal] Super Large Integer Math Calculations
ingemar at ragnemalm.se
Sat Jul 8 12:32:45 CEST 2017
Bart <bartjunk64 at gmail.com> wrote:
> On 7/7/17, noreply at z505.com <noreply at z505.com> wrote:
>> For integers beyond 64 bit, or even beyond 32 bit on a 64 bit machine,
>> why can't the math be broken down into peices the way a human does it on
>> paper, and then theoretically any number can be added and subtracted,
>> even if it is beyond 32/64 bit?
>> type TSuperLargeInt = string;
>> i, j: TSuperLargeInt;
>> output: TSuperLargeInt;
>> i := '100000000000000000009';
>> j := '100000000000000000001';
>> output := AddLargeInts(i,j);
> http://svn.code.sf.net/p/flyingsheep/code/trunk/wtf/ncalc.pp does exactly that
> (all dependenies are also found at
> It can handle integers (and only integers) up to 2GB digits with
> absolut precision.
> It can handle GoogolPlex.
> Calculate 9^99 with absolute precision:
> It's not lightning fast, but there is room for optimization I guess.
Great! I knew someone must have made that! I needed this a few months
ago, but resorted to Python at that time. Now I can use FPC next time. :)
More information about the fpc-pascal