Binomial coefficient with large integers in C

415 Views Asked by At

Some time ago I created a big integer library, to compute the factorial of large integers (up to five million) using FFT and binary splitting. Now I need to compute the binomial coefficent (n! /(k! *(n-k)!)) with big integers (something like n=10000 and k=4000)), and I need to realize a function that implements the diviosn between big integers, or even the inverse of a big integer.

So, I ask you which algorithm I can use to realize this function.

I post below the structure that represents a big int:

typedef struct{
double *arg;        
int  size;      
int nsize;      
} big_f;

Where "arg" is the polynomial rappresentation of a big int, "size" is the number of digits, "nsize" is the length of arg.

Sorry for my bad english and thanks for your attention.

0

There are 0 best solutions below