epoc32/include/stdapis/boost/math/complex/atan.hpp
branchSymbian2
changeset 2 2fe1408b6811
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/boost/math/complex/atan.hpp	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -0,0 +1,36 @@
     1.4 +//  (C) Copyright John Maddock 2005.
     1.5 +//  Use, modification and distribution are subject to the
     1.6 +//  Boost Software License, Version 1.0. (See accompanying file
     1.7 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
     1.8 +
     1.9 +#ifndef BOOST_MATH_COMPLEX_ATAN_INCLUDED
    1.10 +#define BOOST_MATH_COMPLEX_ATAN_INCLUDED
    1.11 +
    1.12 +#ifndef BOOST_MATH_COMPLEX_DETAILS_INCLUDED
    1.13 +#  include <boost/math/complex/details.hpp>
    1.14 +#endif
    1.15 +#ifndef BOOST_MATH_COMPLEX_ATANH_INCLUDED
    1.16 +#  include <boost/math/complex/atanh.hpp>
    1.17 +#endif
    1.18 +
    1.19 +namespace boost{ namespace math{
    1.20 +
    1.21 +template<class T> 
    1.22 +std::complex<T> atan(const std::complex<T>& x)
    1.23 +{
    1.24 +   //
    1.25 +   // We're using the C99 definition here; atan(z) = -i atanh(iz):
    1.26 +   //
    1.27 +   if(x.real() == 0)
    1.28 +   {
    1.29 +      if(x.imag() == 1)
    1.30 +         return std::complex<T>(0, std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : static_cast<T>(HUGE_VAL));
    1.31 +      if(x.imag() == -1)
    1.32 +         return std::complex<T>(0, std::numeric_limits<T>::has_infinity ? -std::numeric_limits<T>::infinity() : -static_cast<T>(HUGE_VAL));
    1.33 +   }
    1.34 +   return ::boost::math::detail::mult_minus_i(::boost::math::atanh(::boost::math::detail::mult_i(x)));
    1.35 +}
    1.36 +
    1.37 +} } // namespaces
    1.38 +
    1.39 +#endif // BOOST_MATH_COMPLEX_ATAN_INCLUDED