- T r = boost::math::trunc(v, pol);
- if(fabs(r) > (std::numeric_limits<boost::long_long_type>::max)())
- return static_cast<boost::long_long_type>(policies::raise_rounding_error("boost::math::lltrunc<%1%>(%1%)", 0, v, pol));
+ typedef typename tools::promote_args<T>::type result_type;
+ result_type r = boost::math::trunc(v, pol);
+ if((r > (std::numeric_limits<boost::long_long_type>::max)()) || (r < (std::numeric_limits<boost::long_long_type>::min)()))
+ return static_cast<boost::long_long_type>(policies::raise_rounding_error("boost::math::lltrunc<%1%>(%1%)", 0, v, static_cast<boost::long_long_type>(0), pol));