diff --git a/src/exponent.c b/src/exponent.c index 6b82961..37642e6 100644 --- a/src/exponent.c +++ b/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; + } } \ No newline at end of file diff --git a/src/exponent.h b/src/exponent.h index 6963b46..f7a030c 100644 --- a/src/exponent.h +++ b/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 \ No newline at end of file