Bump to 1.14.1
[platform/upstream/augeas.git] / tests / infinity.h
1 /* Macros for infinity.
2    Copyright (C) 2011-2016 Free Software Foundation, Inc.
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 3 of the License, or
7    (at your option) any later version.
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
15    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
16
17
18 /* Infinityf () returns a 'float' +Infinity.  */
19
20 /* The Microsoft MSVC 9 compiler chokes on the expression 1.0f / 0.0f.
21    The IBM XL C compiler on z/OS complains.  */
22 #if defined _MSC_VER || (defined __MVS__ && defined __IBMC__)
23 static float
24 Infinityf ()
25 {
26   static float zero = 0.0f;
27   return 1.0f / zero;
28 }
29 #else
30 # define Infinityf() (1.0f / 0.0f)
31 #endif
32
33
34 /* Infinityd () returns a 'double' +Infinity.  */
35
36 /* The Microsoft MSVC 9 compiler chokes on the expression 1.0 / 0.0.
37    The IBM XL C compiler on z/OS complains.  */
38 #if defined _MSC_VER || (defined __MVS__ && defined __IBMC__)
39 static double
40 Infinityd ()
41 {
42   static double zero = 0.0;
43   return 1.0 / zero;
44 }
45 #else
46 # define Infinityd() (1.0 / 0.0)
47 #endif
48
49
50 /* Infinityl () returns a 'long double' +Infinity.  */
51
52 /* The Microsoft MSVC 9 compiler chokes on the expression 1.0L / 0.0L.
53    The IBM XL C compiler on z/OS complains.  */
54 #if defined _MSC_VER || (defined __MVS__ && defined __IBMC__)
55 static long double
56 Infinityl ()
57 {
58   static long double zero = 0.0L;
59   return 1.0L / zero;
60 }
61 #else
62 # define Infinityl() (1.0L / 0.0L)
63 #endif