summaryrefslogtreecommitdiff
path: root/lib/atan2f.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-10-09 00:31:51 +0200
committerBruno Haible <bruno@clisp.org>2011-10-09 00:31:51 +0200
commita365e1e5d3afa9a9f12d38eacaade8cd8fe0020e (patch)
treeafa8b6e0b6d1cf28cc21e9adc2c9e0c2c443cc0d /lib/atan2f.c
parent63dd3e85d427aba822aa3297ed97abc13b14c06a (diff)
downloadgnulib-a365e1e5d3afa9a9f12d38eacaade8cd8fe0020e.tar.gz
New module 'atan2f'.
* lib/math.in.h (atan2f): New declaration. * lib/atan2f.c: New file. * m4/atan2f.m4: New file. * m4/math_h.m4 (gl_MATH_H): Test whether atan2f is declared. (gl_MATH_H_DEFAULTS): Initialize GNULIB_ATAN2F, HAVE_ATAN2F. * modules/math (Makefile.am): Substitute GNULIB_ATAN2F, HAVE_ATAN2F. * modules/atan2f: New file. * tests/test-math-c++.cc: Check the declaration of atan2f. * doc/posix-functions/atan2f.texi: Mention the new module.
Diffstat (limited to 'lib/atan2f.c')
-rw-r--r--lib/atan2f.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/atan2f.c b/lib/atan2f.c
new file mode 100644
index 0000000000..09771f6a3e
--- /dev/null
+++ b/lib/atan2f.c
@@ -0,0 +1,26 @@
+/* Angle of a point in the plane.
+ Copyright (C) 2011 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
+atan2f (float y, float x)
+{
+ return (float) atan2 ((double) y, (double) x);
+}