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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8590
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2007. */
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #include <config.h>
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include <math.h>
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22
12489
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 12421
diff changeset
23 #include "signature.h"
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 12421
diff changeset
24 SIGNATURE_CHECK (ldexpl, long double, (long double, int));
33ab12a7cea2 tests: add signature checks
Eric Blake <ebb9@byu.net>
parents: 12421
diff changeset
25
8590
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #include <float.h>
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 #include "fpucw.h"
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
f56ad1ce5e9e ldexp* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
46 #define LDEXP ldexpl
f56ad1ce5e9e ldexp* tests: More tests.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
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
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 int
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 main ()
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 {
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 DECL_LONG_DOUBLE_ROUNDING
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 BEGIN_LONG_DOUBLE_ROUNDING ();
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56
16046
16310a975709 ldexp, ldexpf, ldexpl: Enhance tests.
Bruno Haible <bruno@clisp.org>
parents: 16034
diff changeset
57 test_function ();
8590
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 return 0;
ebe4e154c5db Tests for module 'ldexpl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 }