| 1 |
// DESCRIPTION |
| 2 |
// |
| 3 |
// Test to check whether the C++ compiler has the double math functions |
| 4 |
// _class, trunc, itrunc, nearest, rsqrt, uitrunc, copysign, drem, finite, |
| 5 |
// and unordered. |
| 6 |
// In sync with AC_CXX_HAVE_SYSTEM_V_MATH (2008-04-12). |
| 7 |
// |
| 8 |
// COPYLEFT |
| 9 |
// |
| 10 |
// Copyright (c) 2009 Theo Papadopoulo <[email protected]> |
| 11 |
// Copyright (c) 2008 Todd Veldhuizen |
| 12 |
// Copyright (c) 2008 Luc Maisonobe <[email protected]> |
| 13 |
// |
| 14 |
// Copying and distribution of this file, with or without modification, are |
| 15 |
// permitted in any medium without royalty provided the copyright notice |
| 16 |
// and this notice are preserved. |
| 17 |
|
| 18 |
#ifndef _ALL_SOURCE |
| 19 |
#define _ALL_SOURCE |
| 20 |
#endif |
| 21 |
#ifndef _XOPEN_SOURCE |
| 22 |
#define _XOPEN_SOURCE |
| 23 |
#endif |
| 24 |
#ifndef _XOPEN_SOURCE_EXTENDED |
| 25 |
#define _XOPEN_SOURCE_EXTENDED 1 |
| 26 |
#endif |
| 27 |
#include <math.h> |
| 28 |
|
| 29 |
int main() { |
| 30 |
double x = 1.0; |
| 31 |
double y = 1.0; |
| 32 |
_class(x); |
| 33 |
trunc(x); |
| 34 |
finite(x); |
| 35 |
itrunc(x); |
| 36 |
nearest(x); |
| 37 |
rsqrt(x); |
| 38 |
uitrunc(x); |
| 39 |
copysign(x,y); |
| 40 |
drem(x,y); |
| 41 |
unordered(x,y); |
| 42 |
return 0; |
| 43 |
} |