Mercurial > hg > octave-kai > gnulib-hg
annotate tests/test-ldexpl.c @ 16616:2f2ef742aa4b
New module 'exp2'.
* lib/math.in.h (exp2): New declaration.
* lib/exp2.c: New file.
* m4/exp2.m4: New file.
* m4/math_h.m4 (gl_MATH_H): Test whether exp2 is declared.
(gl_MATH_H_DEFAULTS): Initialize GNULIB_EXP2, HAVE_DECL_EXP2,
REPLACE_EXP2.
* modules/math (Makefile.am): Substitute GNULIB_EXP2, HAVE_DECL_EXP2,
REPLACE_EXP2.
* modules/exp2: New file.
* tests/test-math-c++.cc: Check the declaration of exp2.
* doc/posix-functions/exp2.texi: Mention the new module and the IRIX
and OpenBSD problems.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Wed, 07 Mar 2012 03:29:32 +0100 |
parents | f56ad1ce5e9e |
children | e542fd46ad6f |
rev | line source |
---|---|
8590 | 1 /* Test of multiplying a 'long double' by a power of 2. |
16201
8250f2777afc
maint: update all copyright year number ranges
Jim Meyering <meyering@redhat.com>
parents:
16046
diff
changeset
|
2 Copyright (C) 2007-2012 Free Software Foundation, Inc. |
8590 | 3 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8754
diff
changeset
|
4 This program is free software: you can redistribute it and/or modify |
8590 | 5 it under the terms of the GNU General Public License as published by |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8754
diff
changeset
|
6 the Free Software Foundation; either version 3 of the License, or |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8754
diff
changeset
|
7 (at your option) any later version. |
8590 | 8 |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8754
diff
changeset
|
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
8590 | 16 |
17 /* Written by Bruno Haible <bruno@clisp.org>, 2007. */ | |
18 | |
19 #include <config.h> | |
20 | |
21 #include <math.h> | |
22 | |
12489 | 23 #include "signature.h" |
24 SIGNATURE_CHECK (ldexpl, long double, (long double, int)); | |
25 | |
8590 | 26 #include <float.h> |
27 | |
28 #include "fpucw.h" | |
29 #include "isnanl-nolibm.h" | |
13834
108bbfd6f03b
frexp, tests: work around ICC bug with -zero
Eric Blake <eblake@redhat.com>
parents:
12559
diff
changeset
|
30 #include "minus-zero.h" |
15595
328819af1c02
Support for MSVC compiler: Avoid division by a literal 0.
Bruno Haible <bruno@clisp.org>
parents:
14079
diff
changeset
|
31 #include "infinity.h" |
11224
5aa57cee93aa
avoid gcc 3.4.3 bug on long double NaN on Irix 6.5
Eric Blake <ebb9@byu.net>
parents:
11002
diff
changeset
|
32 #include "nan.h" |
12496
a48d3d749ca5
Refactor common macros used in tests.
Bruno Haible <bruno@clisp.org>
parents:
12489
diff
changeset
|
33 #include "macros.h" |
8590 | 34 |
16046
16310a975709
ldexp, ldexpf, ldexpl: Enhance tests.
Bruno Haible <bruno@clisp.org>
parents:
16034
diff
changeset
|
35 #undef INFINITY |
16310a975709
ldexp, ldexpf, ldexpl: Enhance tests.
Bruno Haible <bruno@clisp.org>
parents:
16034
diff
changeset
|
36 #undef NAN |
16310a975709
ldexp, ldexpf, ldexpl: Enhance tests.
Bruno Haible <bruno@clisp.org>
parents:
16034
diff
changeset
|
37 |
16310a975709
ldexp, ldexpf, ldexpl: Enhance tests.
Bruno Haible <bruno@clisp.org>
parents:
16034
diff
changeset
|
38 #define DOUBLE long double |
16310a975709
ldexp, ldexpf, ldexpl: Enhance tests.
Bruno Haible <bruno@clisp.org>
parents:
16034
diff
changeset
|
39 #define ISNAN isnanl |
16310a975709
ldexp, ldexpf, ldexpl: Enhance tests.
Bruno Haible <bruno@clisp.org>
parents:
16034
diff
changeset
|
40 #define INFINITY Infinityl () |
16310a975709
ldexp, ldexpf, ldexpl: Enhance tests.
Bruno Haible <bruno@clisp.org>
parents:
16034
diff
changeset
|
41 #define NAN NaNl () |
16310a975709
ldexp, ldexpf, ldexpl: Enhance tests.
Bruno Haible <bruno@clisp.org>
parents:
16034
diff
changeset
|
42 #define L_(literal) literal##L |
16310a975709
ldexp, ldexpf, ldexpl: Enhance tests.
Bruno Haible <bruno@clisp.org>
parents:
16034
diff
changeset
|
43 #define MINUS_ZERO minus_zerol |
16310a975709
ldexp, ldexpf, ldexpl: Enhance tests.
Bruno Haible <bruno@clisp.org>
parents:
16034
diff
changeset
|
44 #define MIN_EXP LDBL_MIN_EXP |
16310a975709
ldexp, ldexpf, ldexpl: Enhance tests.
Bruno Haible <bruno@clisp.org>
parents:
16034
diff
changeset
|
45 #define MAX_EXP LDBL_MAX_EXP |
16560 | 46 #define LDEXP ldexpl |
47 #define RANDOM randoml | |
16046
16310a975709
ldexp, ldexpf, ldexpl: Enhance tests.
Bruno Haible <bruno@clisp.org>
parents:
16034
diff
changeset
|
48 #include "test-ldexp.h" |
16310a975709
ldexp, ldexpf, ldexpl: Enhance tests.
Bruno Haible <bruno@clisp.org>
parents:
16034
diff
changeset
|
49 |
8590 | 50 int |
51 main () | |
52 { | |
53 DECL_LONG_DOUBLE_ROUNDING | |
54 | |
55 BEGIN_LONG_DOUBLE_ROUNDING (); | |
56 | |
16046
16310a975709
ldexp, ldexpf, ldexpl: Enhance tests.
Bruno Haible <bruno@clisp.org>
parents:
16034
diff
changeset
|
57 test_function (); |
8590 | 58 |
59 return 0; | |
60 } |