1 // © Copyright Fernando Luis Cacciola Carballal 2000-2004
2 // Use, modification, and distribution is subject to the Boost Software
3 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // See library home page at http://www.boost.org/libs/numeric/conversion
8 // Contact the author at: fernando_cacciola@hotmail.com
10 #ifndef BOOST_NUMERIC_CONVERSION_BOUNDS_DETAIL_FLC_12NOV2002_HPP
11 #define BOOST_NUMERIC_CONVERSION_BOUNDS_DETAIL_FLC_12NOV2002_HPP
13 #include "boost/limits.hpp"
14 #include "boost/config.hpp"
15 #include "boost/mpl/if.hpp"
17 namespace boost { namespace numeric { namespace boundsdetail
22 typedef std::numeric_limits<N> limits ;
26 static N lowest () { return limits::min BOOST_PREVENT_MACRO_SUBSTITUTION (); }
27 static N highest () { return limits::max BOOST_PREVENT_MACRO_SUBSTITUTION (); }
28 static N smallest() { return static_cast<N>(1); }
34 typedef std::numeric_limits<N> limits ;
38 static N lowest () { return static_cast<N>(-limits::max BOOST_PREVENT_MACRO_SUBSTITUTION ()) ; }
39 static N highest () { return limits::max BOOST_PREVENT_MACRO_SUBSTITUTION (); }
40 static N smallest() { return limits::min BOOST_PREVENT_MACRO_SUBSTITUTION (); }
46 typedef mpl::bool_< ::std::numeric_limits<N>::is_integer > is_int ;
48 typedef Integral<N> impl_int ;
49 typedef Float <N> impl_float ;
51 typedef typename mpl::if_<is_int,impl_int,impl_float>::type type ;
54 } } } // namespace boost::numeric::boundsdetail.
58 ///////////////////////////////////////////////////////////////////////////////////////////////