Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/units/limits.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Boost.Units - A C++ library for zero-overhead dimensional analysis and 
0002 // unit/quantity manipulation and conversion
0003 //
0004 // Copyright (C) 2003-2008 Matthias Christian Schabel
0005 // Copyright (C) 2007-2008 Steven Watanabe
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. (See
0008 // accompanying file LICENSE_1_0.txt or copy at
0009 // http://www.boost.org/LICENSE_1_0.txt)
0010 
0011 #ifndef BOOST_UNITS_LIMITS_HPP
0012 #define BOOST_UNITS_LIMITS_HPP
0013 
0014 ///
0015 /// \file
0016 /// \brief specialize std::numeric_limits for units.
0017 ///
0018 
0019 #include <limits>
0020 
0021 #include <boost/config.hpp>
0022 #include <boost/units/units_fwd.hpp>
0023 
0024 namespace std {
0025 
0026 template<class Unit, class T>
0027 class numeric_limits< ::boost::units::quantity<Unit, T> >
0028 {
0029     public:
0030         typedef ::boost::units::quantity<Unit, T> quantity_type;
0031         BOOST_STATIC_CONSTEXPR bool is_specialized = std::numeric_limits<T>::is_specialized;
0032         static BOOST_CONSTEXPR quantity_type (min)() { return(quantity_type::from_value((std::numeric_limits<T>::min)())); }
0033         static BOOST_CONSTEXPR quantity_type (max)() { return(quantity_type::from_value((std::numeric_limits<T>::max)())); }
0034 #ifndef BOOST_NO_CXX11_NUMERIC_LIMITS
0035         static BOOST_CONSTEXPR quantity_type (lowest)() { return(quantity_type::from_value((std::numeric_limits<T>::lowest)())); }
0036 #endif
0037         BOOST_STATIC_CONSTEXPR int digits = std::numeric_limits<T>::digits;
0038         BOOST_STATIC_CONSTEXPR int digits10 = std::numeric_limits<T>::digits10;
0039 #ifndef BOOST_NO_CXX11_NUMERIC_LIMITS
0040         BOOST_STATIC_CONSTEXPR int max_digits10 = std::numeric_limits<T>::max_digits10;
0041 #endif
0042         BOOST_STATIC_CONSTEXPR bool is_signed = std::numeric_limits<T>::is_signed;
0043         BOOST_STATIC_CONSTEXPR bool is_integer = std::numeric_limits<T>::is_integer;
0044         BOOST_STATIC_CONSTEXPR bool is_exact = std::numeric_limits<T>::is_exact;
0045         BOOST_STATIC_CONSTEXPR int radix = std::numeric_limits<T>::radix;
0046         static BOOST_CONSTEXPR quantity_type epsilon()  { return(quantity_type::from_value(std::numeric_limits<T>::epsilon())); }
0047         static BOOST_CONSTEXPR quantity_type round_error()  { return(quantity_type::from_value(std::numeric_limits<T>::round_error())); }
0048         BOOST_STATIC_CONSTEXPR int min_exponent = std::numeric_limits<T>::min_exponent;
0049         BOOST_STATIC_CONSTEXPR int min_exponent10 = std::numeric_limits<T>::min_exponent10;
0050         BOOST_STATIC_CONSTEXPR int max_exponent = std::numeric_limits<T>::max_exponent;
0051         BOOST_STATIC_CONSTEXPR int max_exponent10 = std::numeric_limits<T>::max_exponent10;
0052         BOOST_STATIC_CONSTEXPR bool has_infinity = std::numeric_limits<T>::has_infinity;
0053         BOOST_STATIC_CONSTEXPR bool has_quiet_NaN = std::numeric_limits<T>::has_quiet_NaN;
0054         BOOST_STATIC_CONSTEXPR bool has_signaling_NaN = std::numeric_limits<T>::has_signaling_NaN;
0055         BOOST_STATIC_CONSTEXPR bool has_denorm_loss = std::numeric_limits<T>::has_denorm_loss;
0056         static BOOST_CONSTEXPR quantity_type infinity()  { return(quantity_type::from_value(std::numeric_limits<T>::infinity())); }
0057         static BOOST_CONSTEXPR quantity_type quiet_NaN()  { return(quantity_type::from_value(std::numeric_limits<T>::quiet_NaN())); }
0058         static BOOST_CONSTEXPR quantity_type signaling_NaN()  { return(quantity_type::from_value(std::numeric_limits<T>::signaling_NaN())); }
0059         static BOOST_CONSTEXPR quantity_type denorm_min()  { return(quantity_type::from_value(std::numeric_limits<T>::denorm_min())); }
0060         BOOST_STATIC_CONSTEXPR bool is_iec559 = std::numeric_limits<T>::is_iec559;
0061         BOOST_STATIC_CONSTEXPR bool is_bounded = std::numeric_limits<T>::is_bounded;
0062         BOOST_STATIC_CONSTEXPR bool is_modulo = std::numeric_limits<T>::is_modulo;
0063         BOOST_STATIC_CONSTEXPR bool traps = std::numeric_limits<T>::traps;
0064         BOOST_STATIC_CONSTEXPR bool tinyness_before = std::numeric_limits<T>::tinyness_before;
0065 #if defined(_STLP_STATIC_CONST_INIT_BUG)
0066         BOOST_STATIC_CONSTEXPR int has_denorm = std::numeric_limits<T>::has_denorm;
0067         BOOST_STATIC_CONSTEXPR int round_style = std::numeric_limits<T>::round_style;
0068 #else
0069         BOOST_STATIC_CONSTEXPR float_denorm_style has_denorm = std::numeric_limits<T>::has_denorm;
0070         BOOST_STATIC_CONSTEXPR float_round_style round_style = std::numeric_limits<T>::round_style;
0071 #endif
0072 };
0073 
0074 }
0075 
0076 #endif // BOOST_UNITS_LIMITS_HPP