Browse Source

add a temporary faculty function

master
fdai7848 11 months ago
parent
commit
1b96219fd5
  1. 14
      src/exponent.c

14
src/exponent.c

@ -1,4 +1,5 @@
#include <stdio.h>
#include <limits.h>
#include "exponent.h"
@ -25,3 +26,16 @@ double expIN(double e, double num){
}
return 0;
}
unsigned long long fac(int x){
unsigned long long prod = 1;
if(x==0) return 1;
for (int i = 1; i <= x; i++){
if (prod > ULLONG_MAX / i){
break;
}
prod*=i;
}
return prod;
}
Loading…
Cancel
Save