3 dnl Copyright (C) 2010-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7 dnl This file is offered as-is, without any warranty.
9 # Macros for floating-point negative zero.
10 # Keep in sync with tests/minus-zero.h!
12 # Expands to code that defines a variable or macro minus_zerof.
13 AC_DEFUN([gl_FLOAT_MINUS_ZERO_CODE],
16 /* minus_zerof represents the value -0.0f. */
17 /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0f.
18 ICC 10.0 has a bug when optimizing the expression -zero.
19 The expression -FLT_MIN * FLT_MIN does not work when cross-compiling
20 to PowerPC on Mac OS X 10.5. */
21 #if defined __hpux || defined __sgi || defined __ICC
23 compute_minus_zerof (void)
25 return -FLT_MIN * FLT_MIN;
27 # define minus_zerof compute_minus_zerof ()
29 float minus_zerof = -0.0f;
33 # Expands to code that defines a variable or macro minus_zerod.
34 AC_DEFUN([gl_DOUBLE_MINUS_ZERO_CODE],
37 /* minus_zerod represents the value -0.0. */
38 /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
39 ICC 10.0 has a bug when optimizing the expression -zero.
40 The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
41 to PowerPC on Mac OS X 10.5. */
42 #if defined __hpux || defined __sgi || defined __ICC
44 compute_minus_zerod (void)
46 return -DBL_MIN * DBL_MIN;
48 # define minus_zerod compute_minus_zerod ()
50 double minus_zerod = -0.0;
54 # Expands to code that defines a variable or macro minus_zerol.
55 AC_DEFUN([gl_LONG_DOUBLE_MINUS_ZERO_CODE],
58 #if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
60 # define LDBL_MIN 3.3621031431120935063E-4932L
62 /* minus_zerol represents the value -0.0L. */
63 /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0L.
64 IRIX cc can't put -0.0L into .data, but can compute at runtime.
65 ICC 10.0 has a bug when optimizing the expression -zero.
66 The expression -LDBL_MIN * LDBL_MIN does not work when cross-compiling
67 to PowerPC on Mac OS X 10.5. */
68 #if defined __hpux || defined __sgi || defined __ICC
70 compute_minus_zerol (void)
72 return -LDBL_MIN * LDBL_MIN;
74 # define minus_zerol compute_minus_zerol ()
76 long double minus_zerol = -0.0L;