Rename module 'pipe' to 'spawn-pipe'.
[pspp] / tests / minus-zero.h
1 /* Macros for floating-point negative zero.
2    Copyright (C) 2010 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 #include <float.h>
18
19 /* minus_zerof represents the value -0.0f.  */
20
21 /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0f.
22    ICC 10.0 has a bug when optimizing the expression -zero.
23    The expression -FLT_MIN * FLT_MIN does not work when cross-compiling
24    to PowerPC on MacOS X 10.5.  */
25 #if defined __hpux || defined __sgi || defined __ICC
26 static float
27 compute_minus_zerof (void)
28 {
29   return -FLT_MIN * FLT_MIN;
30 }
31 # define minus_zerof compute_minus_zerof ()
32 #else
33 float minus_zerof = -0.0f;
34 #endif
35
36
37 /* minus_zerod represents the value -0.0.  */
38
39 /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
40    ICC 10.0 has a bug when optimizing the expression -zero.
41    The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
42    to PowerPC on MacOS X 10.5.  */
43 #if defined __hpux || defined __sgi || defined __ICC
44 static double
45 compute_minus_zerod (void)
46 {
47   return -DBL_MIN * DBL_MIN;
48 }
49 # define minus_zerod compute_minus_zerod ()
50 #else
51 double minus_zerod = -0.0;
52 #endif
53
54 /* minus_zerol represents the value -0.0L.  */
55
56 /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0L.
57    IRIX cc can't put -0.0L into .data, but can compute at runtime.
58    ICC 10.0 has a bug when optimizing the expression -zero.
59    The expression -LDBL_MIN * LDBL_MIN does not work when cross-compiling
60    to PowerPC on MacOS X 10.5.  */
61 #if defined __hpux || defined __sgi || defined __ICC
62 static long double
63 compute_minus_zerol (void)
64 {
65   return -LDBL_MIN * LDBL_MIN;
66 }
67 # define minus_zerol compute_minus_zerol ()
68 #else
69 long double minus_zerol = -0.0L;
70 #endif