| 1 |
// DESCRIPTION |
| 2 |
// |
| 3 |
// Test to check whether the C++ compiler has the double math functions |
| 4 |
// acosh, asinh, atanh, cbrt, expm1, erf, erfc, isnan, j0, j1, jn, gamma, |
| 5 |
// lgamma, ilogb, logb, log1p, rint, y0, y1, yn, hypot, nextafter, remainder |
| 6 |
// and scalb. |
| 7 |
// In sync with AC_CXX_HAVE_IEEE_MATH (2008-04-12). |
| 8 |
// |
| 9 |
// COPYLEFT |
| 10 |
// |
| 11 |
// Copyright (c) 2009 Theo Papadopoulo <[email protected]> |
| 12 |
// Copyright (c) 2008 Todd Veldhuizen |
| 13 |
// Copyright (c) 2008 Luc Maisonobe <[email protected]> |
| 14 |
// |
| 15 |
// Copying and distribution of this file, with or without modification, are |
| 16 |
// permitted in any medium without royalty provided the copyright notice |
| 17 |
// and this notice are preserved. |
| 18 |
|
| 19 |
#ifndef _ALL_SOURCE |
| 20 |
#define _ALL_SOURCE |
| 21 |
#endif |
| 22 |
#ifndef _XOPEN_SOURCE |
| 23 |
#define _XOPEN_SOURCE |
| 24 |
#endif |
| 25 |
#ifndef _XOPEN_SOURCE_EXTENDED |
| 26 |
#define _XOPEN_SOURCE_EXTENDED 1 |
| 27 |
#endif |
| 28 |
#include <math.h> |
| 29 |
|
| 30 |
int main() { |
| 31 |
double x = 1.0; |
| 32 |
double y = 1.0; |
| 33 |
int i = 1; |
| 34 |
acosh(x); |
| 35 |
asinh(x); |
| 36 |
atanh(x); |
| 37 |
cbrt(x); |
| 38 |
expm1(x); |
| 39 |
erf(x); |
| 40 |
erfc(x); |
| 41 |
isnan(x); |
| 42 |
j0(x); |
| 43 |
j1(x); |
| 44 |
jn(i,x); |
| 45 |
ilogb(x); |
| 46 |
logb(x); |
| 47 |
log1p(x); |
| 48 |
rint(x); |
| 49 |
y0(x); |
| 50 |
y1(x); |
| 51 |
yn(i,x); |
| 52 |
# ifdef _THREAD_SAFE |
| 53 |
gamma_r(x,&i); |
| 54 |
lgamma_r(x,&i); |
| 55 |
# else |
| 56 |
gamma(x); |
| 57 |
lgamma(x); |
| 58 |
# endif |
| 59 |
hypot(x,y); |
| 60 |
nextafter(x,y); |
| 61 |
remainder(x,y); |
| 62 |
scalb(x,y); |
| 63 |
return 0; |
| 64 |
} |