view release on metacpan or search on metacpan
include/boost/detail/limits.hpp view on Meta::CPAN
static __number epsilon() throw() { return __number(); }
static __number round_error() throw() { return __number(); }
BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent, 0);
BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent10, 0);
BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent, 0);
BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent10, 0);
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_infinity, false);
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_quiet_NaN, false);
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_signaling_NaN, false);
BOOST_STL_DECLARE_LIMITS_MEMBER(float_denorm_style,
has_denorm,
denorm_absent);
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_denorm_loss, false);
static __number infinity() throw() { return __number(); }
static __number quiet_NaN() throw() { return __number(); }
static __number signaling_NaN() throw() { return __number(); }
static __number denorm_min() throw() { return __number(); }
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_iec559, false);
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, false);
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_modulo, false);
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, traps, false);
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, tinyness_before, false);
BOOST_STL_DECLARE_LIMITS_MEMBER(float_round_style,
round_style,
include/boost/detail/limits.hpp view on Meta::CPAN
};
#endif
// Base class for floating-point numbers.
template <class __number,
int __Digits, int __Digits10,
int __MinExp, int __MaxExp,
int __MinExp10, int __MaxExp10,
unsigned int __InfinityWord,
unsigned int __QNaNWord, unsigned int __SNaNWord,
bool __IsIEC559,
float_round_style __RoundStyle>
class _Floating_limits : public _Numeric_limits_base<__number>
{
public:
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_specialized, true);
BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits, __Digits);
BOOST_STL_DECLARE_LIMITS_MEMBER(int, digits10, __Digits10);
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_signed, true);
BOOST_STL_DECLARE_LIMITS_MEMBER(int, radix, 2);
BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent, __MinExp);
BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent, __MaxExp);
BOOST_STL_DECLARE_LIMITS_MEMBER(int, min_exponent10, __MinExp10);
BOOST_STL_DECLARE_LIMITS_MEMBER(int, max_exponent10, __MaxExp10);
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_infinity, true);
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_quiet_NaN, true);
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_signaling_NaN, true);
BOOST_STL_DECLARE_LIMITS_MEMBER(float_denorm_style,
has_denorm,
denorm_indeterminate);
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, has_denorm_loss, false);
static __number infinity() throw() {
return float_helper<__number, __InfinityWord>::get_word();
}
static __number quiet_NaN() throw() {
return float_helper<__number,__QNaNWord>::get_word();
}
static __number signaling_NaN() throw() {
return float_helper<__number,__SNaNWord>::get_word();
}
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_iec559, __IsIEC559);
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, is_bounded, true);
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, traps, false /* was: true */ );
BOOST_STL_DECLARE_LIMITS_MEMBER(bool, tinyness_before, false);
BOOST_STL_DECLARE_LIMITS_MEMBER(float_round_style, round_style, __RoundStyle);
};
include/boost/detail/limits.hpp view on Meta::CPAN
template<> class numeric_limits<float>
: public _Floating_limits<float,
FLT_MANT_DIG, // Binary digits of precision
FLT_DIG, // Decimal digits of precision
FLT_MIN_EXP, // Minimum exponent
FLT_MAX_EXP, // Maximum exponent
FLT_MIN_10_EXP, // Minimum base 10 exponent
FLT_MAX_10_EXP, // Maximum base 10 exponent
#if defined(BOOST_BIG_ENDIAN)
0x7f80 << (sizeof(int)*CHAR_BIT-16), // Last word of +infinity
0x7f81 << (sizeof(int)*CHAR_BIT-16), // Last word of quiet NaN
0x7fc1 << (sizeof(int)*CHAR_BIT-16), // Last word of signaling NaN
#else
0x7f800000u, // Last word of +infinity
0x7f810000u, // Last word of quiet NaN
0x7fc10000u, // Last word of signaling NaN
#endif
true, // conforms to iec559
round_to_nearest>
{
public:
static float min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return FLT_MIN; }
static float denorm_min() throw() { return FLT_MIN; }
static float max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return FLT_MAX; }
static float epsilon() throw() { return FLT_EPSILON; }
static float round_error() throw() { return 0.5f; } // Units: ulps.
include/boost/detail/limits.hpp view on Meta::CPAN
template<> class numeric_limits<double>
: public _Floating_limits<double,
DBL_MANT_DIG, // Binary digits of precision
DBL_DIG, // Decimal digits of precision
DBL_MIN_EXP, // Minimum exponent
DBL_MAX_EXP, // Maximum exponent
DBL_MIN_10_EXP, // Minimum base 10 exponent
DBL_MAX_10_EXP, // Maximum base 10 exponent
#if defined(BOOST_BIG_ENDIAN)
0x7ff0 << (sizeof(int)*CHAR_BIT-16), // Last word of +infinity
0x7ff1 << (sizeof(int)*CHAR_BIT-16), // Last word of quiet NaN
0x7ff9 << (sizeof(int)*CHAR_BIT-16), // Last word of signaling NaN
#else
0x7ff00000u, // Last word of +infinity
0x7ff10000u, // Last word of quiet NaN
0x7ff90000u, // Last word of signaling NaN
#endif
true, // conforms to iec559
round_to_nearest>
{
public:
static double min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return DBL_MIN; }
static double denorm_min() throw() { return DBL_MIN; }
static double max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return DBL_MAX; }
static double epsilon() throw() { return DBL_EPSILON; }
static double round_error() throw() { return 0.5; } // Units: ulps.
include/boost/detail/limits.hpp view on Meta::CPAN
template<> class numeric_limits<long double>
: public _Floating_limits<long double,
LDBL_MANT_DIG, // Binary digits of precision
LDBL_DIG, // Decimal digits of precision
LDBL_MIN_EXP, // Minimum exponent
LDBL_MAX_EXP, // Maximum exponent
LDBL_MIN_10_EXP,// Minimum base 10 exponent
LDBL_MAX_10_EXP,// Maximum base 10 exponent
#if defined(BOOST_BIG_ENDIAN)
0x7ff0 << (sizeof(int)*CHAR_BIT-16), // Last word of +infinity
0x7ff1 << (sizeof(int)*CHAR_BIT-16), // Last word of quiet NaN
0x7ff9 << (sizeof(int)*CHAR_BIT-16), // Last word of signaling NaN
#else
0x7fff8000u, // Last word of +infinity
0x7fffc000u, // Last word of quiet NaN
0x7fff9000u, // Last word of signaling NaN
#endif
false, // Doesn't conform to iec559
round_to_nearest>
{
public:
static long double min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return LDBL_MIN; }
static long double denorm_min() throw() { return LDBL_MIN; }
static long double max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return LDBL_MAX; }
static long double epsilon() throw() { return LDBL_EPSILON; }
static long double round_error() throw() { return 4; } // Units: ulps.
include/boost/limits.hpp view on Meta::CPAN
BOOST_STATIC_CONSTANT(int, radix = 2);
static BOOST_LLT epsilon() throw() { return 0; };
static BOOST_LLT round_error() throw() { return 0; };
BOOST_STATIC_CONSTANT(int, min_exponent = 0);
BOOST_STATIC_CONSTANT(int, min_exponent10 = 0);
BOOST_STATIC_CONSTANT(int, max_exponent = 0);
BOOST_STATIC_CONSTANT(int, max_exponent10 = 0);
BOOST_STATIC_CONSTANT(bool, has_infinity = false);
BOOST_STATIC_CONSTANT(bool, has_quiet_NaN = false);
BOOST_STATIC_CONSTANT(bool, has_signaling_NaN = false);
BOOST_STATIC_CONSTANT(bool, has_denorm = false);
BOOST_STATIC_CONSTANT(bool, has_denorm_loss = false);
static BOOST_LLT infinity() throw() { return 0; };
static BOOST_LLT quiet_NaN() throw() { return 0; };
static BOOST_LLT signaling_NaN() throw() { return 0; };
static BOOST_LLT denorm_min() throw() { return 0; };
BOOST_STATIC_CONSTANT(bool, is_iec559 = false);
BOOST_STATIC_CONSTANT(bool, is_bounded = false);
BOOST_STATIC_CONSTANT(bool, is_modulo = false);
BOOST_STATIC_CONSTANT(bool, traps = false);
BOOST_STATIC_CONSTANT(bool, tinyness_before = false);
BOOST_STATIC_CONSTANT(float_round_style, round_style = round_toward_zero);
include/boost/limits.hpp view on Meta::CPAN
BOOST_STATIC_CONSTANT(int, radix = 2);
static BOOST_ULLT epsilon() throw() { return 0; };
static BOOST_ULLT round_error() throw() { return 0; };
BOOST_STATIC_CONSTANT(int, min_exponent = 0);
BOOST_STATIC_CONSTANT(int, min_exponent10 = 0);
BOOST_STATIC_CONSTANT(int, max_exponent = 0);
BOOST_STATIC_CONSTANT(int, max_exponent10 = 0);
BOOST_STATIC_CONSTANT(bool, has_infinity = false);
BOOST_STATIC_CONSTANT(bool, has_quiet_NaN = false);
BOOST_STATIC_CONSTANT(bool, has_signaling_NaN = false);
BOOST_STATIC_CONSTANT(bool, has_denorm = false);
BOOST_STATIC_CONSTANT(bool, has_denorm_loss = false);
static BOOST_ULLT infinity() throw() { return 0; };
static BOOST_ULLT quiet_NaN() throw() { return 0; };
static BOOST_ULLT signaling_NaN() throw() { return 0; };
static BOOST_ULLT denorm_min() throw() { return 0; };
BOOST_STATIC_CONSTANT(bool, is_iec559 = false);
BOOST_STATIC_CONSTANT(bool, is_bounded = false);
BOOST_STATIC_CONSTANT(bool, is_modulo = false);
BOOST_STATIC_CONSTANT(bool, traps = false);
BOOST_STATIC_CONSTANT(bool, tinyness_before = false);
BOOST_STATIC_CONSTANT(float_round_style, round_style = round_toward_zero);
include/boost/math/special_functions/acosh.hpp view on Meta::CPAN
T const one = static_cast<T>(1);
T const two = static_cast<T>(2);
static T const taylor_2_bound = sqrt(numeric_limits<T>::epsilon());
static T const taylor_n_bound = sqrt(taylor_2_bound);
static T const upper_taylor_2_bound = one/taylor_2_bound;
if (x < one)
{
if (numeric_limits<T>::has_quiet_NaN)
{
return(numeric_limits<T>::quiet_NaN());
}
else
{
::std::string error_reporting("Argument to atanh is strictly greater than +1 or strictly smaller than -1!");
::std::domain_error bad_argument(error_reporting);
throw(bad_argument);
}
}
else if (x >= taylor_n_bound)
include/boost/math/special_functions/acosh.hpp view on Meta::CPAN
// These are implementation details (for main fare see below)
namespace detail
{
template <
typename T,
bool QuietNanSupported
>
struct acosh_helper2_t
{
static T get_NaN()
{
return(::std::numeric_limits<T>::quiet_NaN());
}
}; // boost::detail::acosh_helper2_t
template<typename T>
struct acosh_helper2_t<T, false>
{
static T get_NaN()
{
::std::string error_reporting("Argument to acosh is greater than or equal to +1!");
::std::domain_error bad_argument(error_reporting);
throw(bad_argument);
}
}; // boost::detail::acosh_helper2_t
} // boost::detail
include/boost/math/special_functions/acosh.hpp view on Meta::CPAN
template<typename T>
inline T acosh(const T x)
{
using ::std::abs;
using ::std::sqrt;
using ::std::log;
using ::std::numeric_limits;
typedef detail::acosh_helper2_t<T, std::numeric_limits<T>::has_quiet_NaN> helper2_type;
T const one = static_cast<T>(1);
T const two = static_cast<T>(2);
static T const taylor_2_bound = sqrt(numeric_limits<T>::epsilon());
static T const taylor_n_bound = sqrt(taylor_2_bound);
static T const upper_taylor_2_bound = one/taylor_2_bound;
if (x < one)
{
return(helper2_type::get_NaN());
}
else if (x >= taylor_n_bound)
{
if (x > upper_taylor_2_bound)
{
// approximation by laurent series in 1/x at 0+ order from -1 to 0
return( log( x*two) );
}
else
{
include/boost/math/special_functions/atanh.hpp view on Meta::CPAN
using ::std::numeric_limits;
T const one = static_cast<T>(1);
T const two = static_cast<T>(2);
static T const taylor_2_bound = sqrt(numeric_limits<T>::epsilon());
static T const taylor_n_bound = sqrt(taylor_2_bound);
if (x < -one)
{
if (numeric_limits<T>::has_quiet_NaN)
{
return(numeric_limits<T>::quiet_NaN());
}
else
{
::std::string error_reporting("Argument to atanh is strictly greater than +1 or strictly smaller than -1!");
::std::domain_error bad_argument(error_reporting);
throw(bad_argument);
}
}
else if (x < -one+numeric_limits<T>::epsilon())
include/boost/math/special_functions/atanh.hpp view on Meta::CPAN
else
{
::std::string error_reporting("Argument to atanh is +1 (result: +Infinity)!");
::std::out_of_range bad_argument(error_reporting);
throw(bad_argument);
}
}
else if (x > +one)
{
if (numeric_limits<T>::has_quiet_NaN)
{
return(numeric_limits<T>::quiet_NaN());
}
else
{
::std::string error_reporting("Argument to atanh is strictly greater than +1 or strictly smaller than -1!");
::std::domain_error bad_argument(error_reporting);
throw(bad_argument);
}
}
else if (abs(x) >= taylor_n_bound)
include/boost/math/special_functions/atanh.hpp view on Meta::CPAN
}
}; // boost::math::detail::atanh_helper1_t
template <
typename T,
bool QuietNanSupported
>
struct atanh_helper2_t
{
static T get_NaN()
{
return(::std::numeric_limits<T>::quiet_NaN());
}
}; // boost::detail::atanh_helper2_t
template<typename T>
struct atanh_helper2_t<T, false>
{
static T get_NaN()
{
::std::string error_reporting("Argument to atanh is strictly greater than +1 or strictly smaller than -1!");
::std::domain_error bad_argument(error_reporting);
throw(bad_argument);
}
}; // boost::detail::atanh_helper2_t
} // boost::detail
include/boost/math/special_functions/atanh.hpp view on Meta::CPAN
template<typename T>
inline T atanh(const T x)
{
using ::std::abs;
using ::std::sqrt;
using ::std::log;
using ::std::numeric_limits;
typedef detail::atanh_helper1_t<T, ::std::numeric_limits<T>::has_infinity> helper1_type;
typedef detail::atanh_helper2_t<T, ::std::numeric_limits<T>::has_quiet_NaN> helper2_type;
T const one = static_cast<T>(1);
T const two = static_cast<T>(2);
static T const taylor_2_bound = sqrt(numeric_limits<T>::epsilon());
static T const taylor_n_bound = sqrt(taylor_2_bound);
if (x < -one)
{
return(helper2_type::get_NaN());
}
else if (x < -one+numeric_limits<T>::epsilon())
{
return(helper1_type::get_neg_infinity());
}
else if (x > +one-numeric_limits<T>::epsilon())
{
return(helper1_type::get_pos_infinity());
}
else if (x > +one)
{
return(helper2_type::get_NaN());
}
else if (abs(x) >= taylor_n_bound)
{
return(log( (one + x) / (one - x) ) / two);
}
else
{
// approximation by taylor series in x at 0 up to order 2
T result = x;
include/boost/numeric/interval/checking.hpp view on Meta::CPAN
assert(std::numeric_limits<T>::has_infinity);
return std::numeric_limits<T>::infinity();
}
static T neg_inf()
{
assert(std::numeric_limits<T>::has_infinity);
return -std::numeric_limits<T>::infinity();
}
static T nan()
{
assert(std::numeric_limits<T>::has_quiet_NaN);
return std::numeric_limits<T>::quiet_NaN();
}
static bool is_nan(const T& x)
{
return std::numeric_limits<T>::has_quiet_NaN && (x != x);
}
static T empty_lower()
{
return (std::numeric_limits<T>::has_quiet_NaN ?
std::numeric_limits<T>::quiet_NaN() : static_cast<T>(1));
}
static T empty_upper()
{
return (std::numeric_limits<T>::has_quiet_NaN ?
std::numeric_limits<T>::quiet_NaN() : static_cast<T>(0));
}
static bool is_empty(const T& l, const T& u)
{
return !(l <= u); // safety for partial orders
}
};
template<class T, class Checking = checking_base<T>,
class Exception = exception_create_empty>
struct checking_no_empty: Checking
include/boost/numeric/interval/limits.hpp view on Meta::CPAN
typedef numeric_limits<T> bl;
public:
static I min BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return I((bl::min)(), (bl::min)()); }
static I max BOOST_PREVENT_MACRO_SUBSTITUTION () throw() { return I((bl::max)(), (bl::max)()); }
static I epsilon() throw() { return I(bl::epsilon(), bl::epsilon()); }
BOOST_STATIC_CONSTANT(float_round_style, round_style = round_indeterminate);
BOOST_STATIC_CONSTANT(bool, is_iec559 = false);
static I infinity () throw() { return I::whole(); }
static I quiet_NaN() throw() { return I::empty(); }
static I signaling_NaN() throw()
{ return I(bl::signaling_NaN(), bl::signaling_Nan()); }
static I denorm_min() throw()
{ return I(bl::denorm_min(), bl::denorm_min()); }
private:
static I round_error(); // hide this on purpose, not yet implemented
};
} // namespace std
#endif