Chris@16: // (C) Copyright John Maddock 2005. Chris@16: // Use, modification and distribution are subject to the Chris@16: // Boost Software License, Version 1.0. (See accompanying file Chris@16: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_MATH_COMPLEX_ACOSH_INCLUDED Chris@16: #define BOOST_MATH_COMPLEX_ACOSH_INCLUDED Chris@16: Chris@16: #ifndef BOOST_MATH_COMPLEX_DETAILS_INCLUDED Chris@16: # include Chris@16: #endif Chris@16: #ifndef BOOST_MATH_COMPLEX_ATANH_INCLUDED Chris@16: # include Chris@16: #endif Chris@16: Chris@16: namespace boost{ namespace math{ Chris@16: Chris@16: template Chris@16: inline std::complex acosh(const std::complex& z) Chris@16: { Chris@16: // Chris@16: // We use the relation acosh(z) = +-i acos(z) Chris@16: // Choosing the sign of multiplier to give real(acosh(z)) >= 0 Chris@16: // as well as compatibility with C99. Chris@16: // Chris@16: std::complex result = boost::math::acos(z); Chris@16: if(!(boost::math::isnan)(result.imag()) && signbit(result.imag())) Chris@16: return detail::mult_i(result); Chris@16: return detail::mult_minus_i(result); Chris@16: } Chris@16: Chris@16: } } // namespaces Chris@16: Chris@16: #endif // BOOST_MATH_COMPLEX_ACOSH_INCLUDED