1 // Copyright 2015-2019 Hans Dembinski 2 // 3 // Distributed under the Boost Software License, Version 1.0. 4 // (See accompanying file LICENSE_1_0.txt 5 // or copy at http://www.boost.org/LICENSE_1_0.txt) 6 7 #ifndef BOOST_HISTOGRAM_DETAIL_LIMITS_HPP 8 #define BOOST_HISTOGRAM_DETAIL_LIMITS_HPP 9 10 #include <limits> 11 12 namespace boost { 13 namespace histogram { 14 namespace detail { 15 16 template <class T> lowest()17constexpr T lowest() { 18 return std::numeric_limits<T>::lowest(); 19 } 20 21 template <> lowest()22constexpr double lowest() { 23 return -std::numeric_limits<double>::infinity(); 24 } 25 26 template <> lowest()27constexpr float lowest() { 28 return -std::numeric_limits<float>::infinity(); 29 } 30 31 template <class T> highest()32constexpr T highest() { 33 return (std::numeric_limits<T>::max)(); 34 } 35 36 template <> highest()37constexpr double highest() { 38 return std::numeric_limits<double>::infinity(); 39 } 40 41 template <> highest()42constexpr float highest() { 43 return std::numeric_limits<float>::infinity(); 44 } 45 46 } // namespace detail 47 } // namespace histogram 48 } // namespace boost 49 50 #endif 51