MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / float_distance

Function float_distance

extern/boost/boost/math/special_functions/next.hpp:681–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679
680template <class T, class U, class Policy>
681inline typename tools::promote_args<T, U>::type float_distance(const T& a, const U& b, const Policy& pol)
682{
683 //
684 // We allow ONE of a and b to be an integer type, otherwise both must be the SAME type.
685 //
686 static_assert(
687 (std::is_same<T, U>::value
688 || (std::is_integral<T>::value && !std::is_integral<U>::value)
689 || (!std::is_integral<T>::value && std::is_integral<U>::value)
690 || (std::numeric_limits<T>::is_specialized && std::numeric_limits<U>::is_specialized
691 && (std::numeric_limits<T>::digits == std::numeric_limits<U>::digits)
692 && (std::numeric_limits<T>::radix == std::numeric_limits<U>::radix)
693 && !std::numeric_limits<T>::is_integer && !std::numeric_limits<U>::is_integer)),
694 "Float distance between two different floating point types is undefined.");
695
696 BOOST_IF_CONSTEXPR (!std::is_same<T, U>::value)
697 {
698 BOOST_IF_CONSTEXPR(std::is_integral<T>::value)
699 {
700 return float_distance(static_cast<U>(a), b, pol);
701 }
702 else
703 {
704 return float_distance(a, static_cast<T>(b), pol);
705 }
706 }
707 else
708 {
709 typedef typename tools::promote_args<T, U>::type result_type;

Callers 4

second_order_root_finderFunction · 0.85
float_distance_impFunction · 0.85
BOOST_IF_CONSTEXPRFunction · 0.85
float_advance_impFunction · 0.85

Calls 1

BOOST_IF_CONSTEXPRFunction · 0.70

Tested by

no test coverage detected