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