gcc/libstdc++-v3/testsuite/26_numerics/cmath/overloads.cc
Paul Kienzle 52ddaf41bf re PR libstdc++/13450 (std::pow(std::complex<double>(-1.,0.),0.5) yields (NaN,0))
2004-03-10  Paul Kienzle  <pkienzle@nist.gov>
	    Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/13450
	* include/std/std_complex.h (pow(const complex&, const _Tp&),
	pow(const _Tp&, const complex&)): Use cmath pow only when safe.
	* testsuite/26_numerics/complex/13450.cc: New.

	* testsuite/26_numerics/cmath/overloads.C: Rename to overloads.cc.
	* testsuite/26_numerics/complex/pow.C: Rename to pow.cc and fix.

From-SVN: r79227
2004-03-10 09:16:12 +00:00

28 lines
465 B
C++

// PR 3181
// Origin: pete@toyon.com
#include <cmath>
int main()
{
int i = -1;
int j = 9;
double ans;
ans = std::acos(i);
ans = std::asin(i);
ans = std::atan(i);
ans = std::atan2(i, j);
ans = std::cos(i);
ans = std::cosh(i);
ans = std::exp(i);
ans = std::fabs(i);
ans = std::floor(i);
ans = std::log(i);
ans = std::log10(i);
ans = std::sqrt(i);
ans = std::sin(i);
ans = std::sinh(j);
ans = std::tan(i);
ans = std::tanh(i);
}