Debian Codegraph @

cmake/cxx_tests/have_complex_math1.cpp

raw
1 // DESCRIPTION
2 //
3 // Test to check whether the C++ compiler has the complex math
4 // functions cos, cosh, exp, log, pow, sin, sinh, sqrt, tan and
5 // tanh.
6 // In sync with AC_CXX_HAVE_COMPLEX_MATH1 (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 #include <complex>
19 using namespace std;
20
21 int main() {
22 complex<double> x(1.0,1.0),y(1.0, 1.0);
23 cos(x);
24 cosh(x);
25 exp(x);
26 log(x);
27 pow(x,1);
28 pow(x,double(2.0));
29 pow(x,y);
30 pow(double(2.0),x);
31 sin(x);
32 sinh(x);
33 sqrt(x);
34 tan(x);
35 tanh(x);
36 return 0;
37 }