Here’s a new problem. Consider the following C code:
#include<gmp.h>
void fibonacci(mpz_t** fibs, unsigned int l) {
//Set the first two numbers
if(l > 0) {
mpz_set_ui(*fibs[0], 0);
}
if(l > 1) {
mpz_set_ui(*fibs[1], 1);
}
//Calculate the remaining array
if(l > 2) {
mpz_t temp;
mpz_init(temp);
for(int k = 2; k < l; k++) {
mpz_add(temp, *fibs[k-1], *fibs[k-2]);
mpz_set(*fibs[k], temp);
}
}
}
Calling this in Julia works perfectly well up to l=94, but at l=95 the numbers become so large that C has to create new limbs. This crashes Julia with a spectacularly long error message.