aboutsummaryrefslogtreecommitdiff
path: root/src/misc.h
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2018-09-13 10:04:56 -0500
committertlatorre <tlatorre@uchicago.edu>2018-09-13 10:04:56 -0500
commitcf903578dab6002be56fa00f3e2064f904c95fba (patch)
treeb483084dd63d63fe16e95fba8e7663ebd5237269 /src/misc.h
parent8beebac19b9351cdc6108ea31eeda6531d75540b (diff)
downloadsddm-cf903578dab6002be56fa00f3e2064f904c95fba.tar.gz
sddm-cf903578dab6002be56fa00f3e2064f904c95fba.tar.bz2
sddm-cf903578dab6002be56fa00f3e2064f904c95fba.zip
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.
Diffstat (limited to 'src/misc.h')
-rw-r--r--src/misc.h2
1 files changed, 2 insertions, 0 deletions
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 <stdlib.h> /* 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);