1 // { dg-do run { xfail broken_cplxf_arg } }
3 // Copyright (C) 2004, 2009 Free Software Foundation
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this library; see the file COPYING3. If not see
18 // <http://www.gnu.org/licenses/>.
20 // 26.2.8 complex transcendentals
24 #include <testsuite_hooks.h>
27 void test01_do(T a, T b)
30 bool test __attribute__((unused)) = true;
31 typedef complex<T> cplx;
33 T eps = numeric_limits<T>::epsilon() * 100;
35 cplx ref = pow(cplx(a, T()), cplx(b, T()));
36 cplx res1 = pow(a, cplx(b, T()));
37 cplx res2 = pow(cplx(a, T()), b);
39 VERIFY( abs(ref - res1) < eps );
40 VERIFY( abs(ref - res2) < eps );
41 VERIFY( abs(res1 - res2) < eps );
63 #if __LDBL_MANT_DIG__ != 106
64 /* For IBM long double, epsilon is too small (since 1.0 plus any
65 double is representable) to be able to expect results within
66 epsilon * 100 (which may be much less than 1ulp for a particular
67 long double value). */
68 long double ld1 = -1.0l;
69 long double ld2 = 0.5l;