diff options
author | Bruno Haible <bruno@clisp.org> | 2011-10-06 11:28:38 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2011-10-06 11:28:38 +0200 |
commit | df8ad3525d27df0b821539df90af26c7fa6d3188 (patch) | |
tree | 7ed53664089869c2c1b11fd3c9bbbb3b7c9eea54 /lib/frexpf.c | |
parent | 251b961d0fab0c655f732d2034771f75fa63a409 (diff) | |
download | gnulib-df8ad3525d27df0b821539df90af26c7fa6d3188.tar.gz |
New module 'frexpf'.
* lib/math.in.h (frexpf): New declaration.
* lib/frexpf.c: New file.
* m4/frexpf.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether frexpf is declared.
(gl_MATH_H_DEFAULTS): Initialize GNULIB_FREXPF, HAVE_FREXPF.
* modules/math (Makefile.am): Substitute GNULIB_FREXPF, HAVE_FREXPF.
* modules/frexpf: New file.
* tests/test-math-c++.cc: Check the declaration of frexpf.
* doc/posix-functions/frexpf.texi: Mention the new module.
Diffstat (limited to 'lib/frexpf.c')
-rw-r--r-- | lib/frexpf.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/frexpf.c b/lib/frexpf.c new file mode 100644 index 0000000000..2bd5f51ecf --- /dev/null +++ b/lib/frexpf.c @@ -0,0 +1,26 @@ +/* Split a float into fraction and mantissa. + 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 +frexpf (float x, int *expptr) +{ + return (float) frexp ((double) x, expptr); +} |