I'm trying to calculate 52! using C language. But it seems that somehow, I can't handle big numbers. I can't telle if it's my compiler or if I'm doing it wrong..
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
uint64_t factorielle(int n) {
if(n == 0)
return 1;
else
return n * factorielle(n-1);
}
int main(int argn, char** argv) {
printf("Number : %"PRId64"\n", factorielle(52));
return 0;
}
I get this result :
Number : -8452693550620999680
I tryed with GCC 5.3.0, GCC 7.2.0 and Zapcc 5.0.0
Thanks a lot !