Hi, there
I wrote a library for big integer arithmetic here:
https://github.com/coshcage/pbintIt's called pbint means portable big integer library.
The difference between pbint and gnu gmp is that you don't need to control memory manually in pbint, pbint combined heap memory management functions to arithmetic functions together. pbint is smaller and faster. If you are interested in high precision calculation and large integer arithmetic, pbint is suitable for you.
I also tested and compiled pbint with Pelles C compiler. Before compiling pbint with Pelles C you need to alter pbint according to the following instructions:
Delete line 568 register qualifier in pbk.c.
Delete line 621 register qualifier in pbk.c. But don't delete variable declaration clause.
Testing shows to calculate factorial 2000 on an Intel Core i9 9 Gen microprocessor only needs 0.01 seconds.
Here's the code that I used for testing:
#include <stdio.h>
#include <Windows.h>
#include "pbk.h"
#include "pbm.h"
int main()
{
P_BINT pc;
P_BNUM p;
LARGE_INTEGER la, lb, lc;
pc = pbkCreateBint(0);
p = pbkCreateBnum(10);
QueryPerformanceFrequency(&lc);
QueryPerformanceCounter(&la);
pbmUbFactorial(pc, 2000); // 2000!
QueryPerformanceCounter(&lb);
printf("%lf\n", (double)(lb.QuadPart - la.QuadPart) / (double)lc.QuadPart);
pbkBintToDecimalBnum(p, pc);
pbkPrintBnum(p);
return 0;
}
Kind regards,
Cosh.