summaryrefslogtreecommitdiff
path: root/lib/log1pf.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2012-03-10 22:28:49 +0100
committerBruno Haible <bruno@clisp.org>2012-03-11 02:40:32 +0100
commit6a2bdd8e10abd669186bf2d618bfb1f106c8fcb7 (patch)
treed58737ec5f015ecd6ae636053aa9b40669c9c2ca /lib/log1pf.c
parentf846e191ec7ffc638fc2ebbc6fdfa7f75e37d179 (diff)
downloadgnulib-6a2bdd8e10abd669186bf2d618bfb1f106c8fcb7.tar.gz
New module 'log1pf'.
* lib/math.in.h (log1pf): New declaration. * lib/log1pf.c: New file. * m4/log1pf.m4: New file. * m4/math_h.m4 (gl_MATH_H): Test whether log1pf is declared. (gl_MATH_H_DEFAULTS): Initialize GNULIB_LOG1PF, HAVE_LOG1PF, REPLACE_LOG1PF. * modules/math (Makefile.am): Substitute GNULIB_LOG1PF, HAVE_LOG1PF, REPLACE_LOG1PF. * modules/log1pf: New file. * tests/test-math-c++.cc: Check the declaration of log1pf. * doc/posix-functions/log1pf.texi: Mention the new module.
Diffstat (limited to 'lib/log1pf.c')
-rw-r--r--lib/log1pf.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/log1pf.c b/lib/log1pf.c
new file mode 100644
index 0000000000..4d889faa2d
--- /dev/null
+++ b/lib/log1pf.c
@@ -0,0 +1,26 @@
+/* Natural logarithm of 1 plus argument.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <math.h>
+
+float
+log1pf (float x)
+{
+ return (float) log1p ((double) x);
+}