aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--config.h.in2
-rw-r--r--src/classifiers/bayes.c4
3 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3c65bfb9c..fe0c2cab8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -883,6 +883,7 @@ CHECK_FUNCTION_EXISTS(wait4 HAVE_WAIT4)
CHECK_FUNCTION_EXISTS(waitpid HAVE_WAITPID)
CHECK_FUNCTION_EXISTS(flock HAVE_FLOCK)
CHECK_FUNCTION_EXISTS(tanhl HAVE_TANHL)
+CHECK_FUNCTION_EXISTS(expl HAVE_EXPL)
CHECK_FUNCTION_EXISTS(sendfile HAVE_SENDFILE)
CHECK_FUNCTION_EXISTS(mkstemp HAVE_MKSTEMP)
CHECK_FUNCTION_EXISTS(setitimer HAVE_SETITIMER)
diff --git a/config.h.in b/config.h.in
index 0ecb53059..a39f2d17e 100644
--- a/config.h.in
+++ b/config.h.in
@@ -144,6 +144,8 @@
#cmakedefine HAVE_TANHL 1
+#cmakedefine HAVE_EXPL 1
+
#cmakedefine HAVE_SA_SIGINFO 1
#cmakedefine DEBUG_MODE 1
diff --git a/src/classifiers/bayes.c b/src/classifiers/bayes.c
index 77e02ea6b..f8aed3ac7 100644
--- a/src/classifiers/bayes.c
+++ b/src/classifiers/bayes.c
@@ -121,7 +121,11 @@ inv_chi_square (gdouble value, gint freedom_deg)
value /= 2.;
errno = 0;
+#ifdef HAVE_EXPL
prob = expl (-value);
+#else
+ prob = exp (-value);
+#endif
if (errno == ERANGE) {
msg_err ("exp overflow");
return 0;