Mercurial > gnulib
annotate tests/test-frexp.c @ 40057:b06060465f09
maint: Run 'make update-copyright'
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 01 Jan 2019 00:25:11 +0100 |
parents | 10eb9086bea0 |
children |
rev | line source |
---|---|
8492 | 1 /* Test of splitting a double into fraction and mantissa. |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
2 Copyright (C) 2007-2019 Free Software Foundation, Inc. |
8492 | 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 |
8492 | 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. |
8492 | 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 | |
19190 | 15 along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
8492 | 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 (frexp, double, (double, int *)); | |
25 | |
8492 | 26 #include <float.h> |
27 | |
10264
ebb7ea0c94e8
Rename isnand.h to isnand-nolibm.h, similarly for isnanf.h.
Ben Pfaff <blp@cs.stanford.edu>
parents:
9916
diff
changeset
|
28 #include "isnand-nolibm.h" |
13834
108bbfd6f03b
frexp, tests: work around ICC bug with -zero
Eric Blake <eblake@redhat.com>
parents:
12559
diff
changeset
|
29 #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
|
30 #include "infinity.h" |
9854
baba3b346ab2
Use macros NaNf, NaNd, NaNl instead of NAN.
Bruno Haible <bruno@clisp.org>
parents:
9850
diff
changeset
|
31 #include "nan.h" |
12496
a48d3d749ca5
Refactor common macros used in tests.
Bruno Haible <bruno@clisp.org>
parents:
12489
diff
changeset
|
32 #include "macros.h" |
8545
418f381347dc
Work around IRIX 6.5 cc compiler bug, which simplifies x != x to false.
Bruno Haible <bruno@clisp.org>
parents:
8543
diff
changeset
|
33 |
9860
6c7dda791c34
Avoid some warnings from "gcc -Wshadow".
Jim Meyering <meyering@redhat.com>
parents:
9854
diff
changeset
|
34 /* Avoid some warnings from "gcc -Wshadow". |
6c7dda791c34
Avoid some warnings from "gcc -Wshadow".
Jim Meyering <meyering@redhat.com>
parents:
9854
diff
changeset
|
35 This file doesn't use the exp() function. */ |
9916
3826b3abb5d0
Fix compilation failure on AIX with xlc.
Bruno Haible <bruno@clisp.org>
parents:
9889
diff
changeset
|
36 #undef exp |
9860
6c7dda791c34
Avoid some warnings from "gcc -Wshadow".
Jim Meyering <meyering@redhat.com>
parents:
9854
diff
changeset
|
37 #define exp exponent |
6c7dda791c34
Avoid some warnings from "gcc -Wshadow".
Jim Meyering <meyering@redhat.com>
parents:
9854
diff
changeset
|
38 |
16557 | 39 #undef INFINITY |
40 #undef NAN | |
41 | |
42 #define DOUBLE double | |
43 /* The use of 'volatile' guarantees that excess precision bits are dropped | |
44 when dealing with denormalized numbers. It is necessary on x86 systems | |
45 where double-floats are not IEEE compliant by default, to avoid that the | |
46 results become platform and compiler option dependent. 'volatile' is a | |
47 portable alternative to gcc's -ffloat-store option. */ | |
48 #define VOLATILE volatile | |
49 #define ISNAN isnand | |
50 #define INFINITY Infinityd () | |
51 #define NAN NaNd () | |
52 #define L_(literal) literal | |
53 #define MINUS_ZERO minus_zerod | |
54 #define MAX_EXP DBL_MAX_EXP | |
55 #define MIN_EXP DBL_MIN_EXP | |
56 #define MIN_NORMAL_EXP DBL_MIN_EXP | |
57 #define FREXP frexp | |
16559 | 58 #define RANDOM randomd |
16557 | 59 #include "test-frexp.h" |
8492 | 60 |
61 int | |
62 main () | |
63 { | |
16557 | 64 test_function (); |
8492 | 65 |
66 return 0; | |
67 } |