1 /* Macros for floating-point negative zero.
2 Copyright (C) 2010 Free Software Foundation, Inc.
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.
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.
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/>. */
19 /* minus_zerof represents the value -0.0f. */
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
27 compute_minus_zerof (void)
29 return -FLT_MIN * FLT_MIN;
31 # define minus_zerof compute_minus_zerof ()
33 float minus_zerof = -0.0f;
37 /* minus_zerod represents the value -0.0. */
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
45 compute_minus_zerod (void)
47 return -DBL_MIN * DBL_MIN;
49 # define minus_zerod compute_minus_zerod ()
51 double minus_zerod = -0.0;
54 /* minus_zerol represents the value -0.0L. */
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
63 compute_minus_zerol (void)
65 return -LDBL_MIN * LDBL_MIN;
67 # define minus_zerol compute_minus_zerol ()
69 long double minus_zerol = -0.0L;