summaryrefslogtreecommitdiff
path: root/lib/exp2f.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2012-03-08 20:24:53 +0100
committerBruno Haible <bruno@clisp.org>2012-03-09 02:15:35 +0100
commitbff4a106924f9531c45661e5d163470e9faa521a (patch)
tree4e3a5a20287aa1d6b07ef9d6ed1af7773bebca4c /lib/exp2f.c
parent6b168421262adda71eed4cca137c34c1a9d6b981 (diff)
downloadgnulib-bff4a106924f9531c45661e5d163470e9faa521a.tar.gz
New module 'exp2f'.
* lib/math.in.h (exp2f): New declaration. * lib/exp2f.c: New file. * m4/exp2f.m4: New file. * m4/math_h.m4 (gl_MATH_H): Test whether exp2f is declared. (gl_MATH_H_DEFAULTS): Initialize GNULIB_EXP2F, HAVE_DECL_EXP2F. * modules/math (Makefile.am): Substitute GNULIB_EXP2F, HAVE_DECL_EXP2F. * modules/exp2f: New file. * tests/test-math-c++.cc: Check the declaration of exp2f. * doc/posix-functions/exp2f.texi: Mention the new module and the IRIX problem.
Diffstat (limited to 'lib/exp2f.c')
-rw-r--r--lib/exp2f.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/exp2f.c b/lib/exp2f.c
new file mode 100644
index 0000000000..a3a3cdd45c
--- /dev/null
+++ b/lib/exp2f.c
@@ -0,0 +1,26 @@
+/* Exponential base 2 function.
+ Copyright (C) 2011-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
+exp2f (float x)
+{
+ return (float) exp2 ((double) x);
+}