Browse Source

add support for float basis

master
fdai7848 12 months ago
parent
commit
4b9c7d8e14
  1. 12
      src/exponent.c
  2. 1
      src/exponent.h

12
src/exponent.c

@ -22,4 +22,16 @@ float expIN(int e, int num){
printf("%f\n", 1.0 / (float) expI((e*-1), num));
return (1.0 / (float) expI((e*-1), num));
}
}
float expF(int e, float num){
float prod = 1;
if(e==0){
return 1;
}else{
for(int i = 1; i <=e; i++){
prod *= num;
}
return prod;
}
}

1
src/exponent.h

@ -3,5 +3,6 @@
int expI(unsigned int e, int num);
float expIN(int e, int num);
float expF(int e, float num);
#endif // exponent.h
Loading…
Cancel
Save