From cf903578dab6002be56fa00f3e2064f904c95fba Mon Sep 17 00:00:00 2001 From: tlatorre Date: Thu, 13 Sep 2018 10:04:56 -0500 Subject: add a function to compute log(n) for integer n This commit adds the function ln() to compute log(n) for integer n. It uses a lookup table for n < 100 to speed things up. --- src/misc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/misc.h') diff --git a/src/misc.h b/src/misc.h index eb62e46..6e9095a 100644 --- a/src/misc.h +++ b/src/misc.h @@ -3,8 +3,10 @@ #include /* for size_t */ +#define LN_MAX 100 #define LNFACT_MAX 100 +double ln(unsigned int n); double lnfact(unsigned int n); double kahan_sum(double *x, size_t n); double interp1d(double x, double *xp, double *yp, size_t n); -- cgit