diff --git a/src/exponent.c b/src/exponent.c index ca2438f..00a5e39 100644 --- a/src/exponent.c +++ b/src/exponent.c @@ -10,4 +10,12 @@ int expI(unsigned int e, int num){ } return prod; } +} + +float expIN(int e, int num){ + if(e>0){ + return (float) expI(e, num); + }else{ + return 1.0 / (float) expI(e, num); + } } \ No newline at end of file diff --git a/src/exponent.h b/src/exponent.h index 1fea7aa..6963b46 100644 --- a/src/exponent.h +++ b/src/exponent.h @@ -2,5 +2,6 @@ #define EXPONENT_H int expI(unsigned int e, int num); +float expIN(int e, int num); #endif // exponent.h \ No newline at end of file