From 1a5cd4f32eb3d103310b61cbeaba44558790f19e Mon Sep 17 00:00:00 2001 From: fdai7848 Date: Tue, 30 Jan 2024 11:39:35 +0100 Subject: [PATCH] add exponential function --- src/exponent.c | 8 ++++++++ src/exponent.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/exponent.c b/src/exponent.c index e82de4e..b1135fd 100644 --- a/src/exponent.c +++ b/src/exponent.c @@ -39,3 +39,11 @@ unsigned long long fac(int x){ return prod; } + +double exponential(double x){ + double sum = 0.0; + for(int i = 1; i<=21; i++){ + sum += (1/fac(i)*(expIN(i,x))); + } + return sum; +} \ No newline at end of file diff --git a/src/exponent.h b/src/exponent.h index 8f77ae2..8a09fec 100644 --- a/src/exponent.h +++ b/src/exponent.h @@ -3,5 +3,6 @@ double expI(double e, double num); double expIN(double e, double num); +double exponential(double x); #endif // exponent.h \ No newline at end of file