Browse Source

add support for negative decimal exponents

master
fdai7848 11 months ago
parent
commit
deb72cdbb9
  1. 7
      src/exponent.c

7
src/exponent.c

@ -30,12 +30,15 @@ double expIN(double e, double num){
else{ else{
return (1.0 / expI((e*-1), num)); return (1.0 / expI((e*-1), num));
} }
}else{
}else if(num > 0.0){
if(e>0.0){ if(e>0.0){
return exponential(e*logN(num, 0.00000001)); return exponential(e*logN(num, 0.00000001));
} }
else{
return (1.0 / exponential((-1*e)*logN(num, 0.00000001)));
}
} }
return 0;
return -1;
} }
unsigned long long fac(int x){ unsigned long long fac(int x){

Loading…
Cancel
Save