mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-23 11:20:07 +00:00
f82a4bdb73
TS 18661-1 defines SNAN macros for signaling NaN values, suitable for use in static initializers. This patch adds them to glibc's <math.h> (provided you are building with GCC 3.3 or later; no attempt is made to provide any kind of nonconforming fallback for older compilers without the __builtin_nans functions). Tested for x86_64 and x86. * math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT) && __GNUC_PREREQ (3, 3)] (SNANF): New macro. [__GLIBC_USE (IEC_60559_BFP_EXT) && __GNUC_PREREQ (3, 3)] (SNAN): Likewise. [__GLIBC_USE (IEC_60559_BFP_EXT) && __GNUC_PREREQ (3, 3)] (SNANL): Likewise. * manual/arith.texi (Infinity and NaN): Document SNANF, SNAN and SNANL. * math/test-double.h (snan_value_MACRO): New macro. * math/test-float.h (snan_value_MACRO): Likewise. * math/test-ldouble.h (snan_value_MACRO): Likewise. * math/libm-test.inc (issignaling_test_data): Add tests of snan_value_MACRO.
31 lines
1.2 KiB
C
31 lines
1.2 KiB
C
/* Common definitions for libm tests for long double.
|
|
Copyright (C) 1997-2016 Free Software Foundation, Inc.
|
|
This file is part of the GNU C Library.
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Lesser General Public
|
|
License as published by the Free Software Foundation; either
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
License along with the GNU C Library; if not, see
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
#define FUNC(function) function##l
|
|
#define FLOAT long double
|
|
#define PRINTF_EXPR "Le"
|
|
#define PRINTF_XEXPR "La"
|
|
#define PRINTF_NEXPR "Lf"
|
|
#define BUILD_COMPLEX(real, imag) (CMPLXL ((real), (imag)))
|
|
#define PREFIX LDBL
|
|
#define TYPE_STR "ldouble"
|
|
#define LIT(x) (x ## L)
|
|
#define LITM(x) x ## l
|
|
#define FTOSTR snprintf
|
|
#define snan_value_MACRO SNANL
|