diff options
Diffstat (limited to 'boost/multiprecision/detail/functions/trig.hpp')
-rw-r--r-- | boost/multiprecision/detail/functions/trig.hpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/boost/multiprecision/detail/functions/trig.hpp b/boost/multiprecision/detail/functions/trig.hpp index 5d4e2639c2..be2a9deb77 100644 --- a/boost/multiprecision/detail/functions/trig.hpp +++ b/boost/multiprecision/detail/functions/trig.hpp @@ -486,14 +486,18 @@ void eval_asin(T& result, const T& x) result.negate(); return; } - +#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS + typedef typename boost::multiprecision::detail::canonical<long double, T>::type guess_type; +#else + typedef fp_type guess_type; +#endif // Get initial estimate using standard math function asin. - double dd; + guess_type dd; eval_convert_to(&dd, xx); - result = fp_type(std::asin(dd)); + result = (guess_type)(std::asin(dd)); - unsigned current_digits = std::numeric_limits<double>::digits - 5; + unsigned current_digits = std::numeric_limits<guess_type>::digits - 5; unsigned target_precision = boost::multiprecision::detail::digits2<number<T, et_on> >::value; // Newton-Raphson iteration |