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