| | 680 | namespace std { |
| | 681 | |
| | 682 | template<typename IntType> |
| | 683 | struct numeric_limits< ::boost::rational<IntType> > |
| | 684 | { |
| | 685 | static BOOST_CONSTEXPR_OR_CONST bool is_specialized = true; |
| | 686 | static BOOST_CONSTEXPR_OR_CONST bool is_signed = ::std::numeric_limits<IntType>::is_signed; |
| | 687 | static BOOST_CONSTEXPR_OR_CONST bool is_integer = false; |
| | 688 | static BOOST_CONSTEXPR_OR_CONST bool is_exact = true; |
| | 689 | |
| | 690 | static BOOST_CONSTEXPR_OR_CONST bool has_infinity = false; |
| | 691 | static BOOST_CONSTEXPR_OR_CONST bool has_quiet_NaN = false; |
| | 692 | static BOOST_CONSTEXPR_OR_CONST bool has_signaling_NaN = false; |
| | 693 | |
| | 694 | static BOOST_CONSTEXPR_OR_CONST std::float_denorm_style has_denorm = std::denorm_absent; |
| | 695 | static BOOST_CONSTEXPR_OR_CONST bool has_denorm_loss = false; |
| | 696 | static BOOST_CONSTEXPR_OR_CONST float_round_style round_style = round_toward_zero; |
| | 697 | static BOOST_CONSTEXPR_OR_CONST bool is_iec559 = false; |
| | 698 | static BOOST_CONSTEXPR_OR_CONST bool is_bounded = true; |
| | 699 | static BOOST_CONSTEXPR_OR_CONST bool is_modulo = false; |
| | 700 | |
| | 701 | static BOOST_CONSTEXPR_OR_CONST int digits = ::std::numeric_limits<IntType>::digits; |
| | 702 | static BOOST_CONSTEXPR_OR_CONST int digits10 = ::std::numeric_limits<IntType>::digits10; |
| | 703 | // Add #ifndef BOOST_NO_CXX11_NUMERIC_LIMITS ? |
| | 704 | static BOOST_CONSTEXPR_OR_CONST int max_digits10 = 0; |
| | 705 | static BOOST_CONSTEXPR_OR_CONST int radix = ::std::numeric_limits<IntType>::radix; |
| | 706 | static BOOST_CONSTEXPR_OR_CONST int min_exponent = 0; |
| | 707 | static BOOST_CONSTEXPR_OR_CONST int min_exponent10 = 0; |
| | 708 | static BOOST_CONSTEXPR_OR_CONST int max_exponent = 0; |
| | 709 | static BOOST_CONSTEXPR_OR_CONST int max_exponent10 = 0; |
| | 710 | |
| | 711 | static BOOST_CONSTEXPR_OR_CONST bool traps = true; |
| | 712 | static BOOST_CONSTEXPR_OR_CONST bool tinyness_before = false; |
| | 713 | |
| | 714 | static BOOST_CONSTEXPR ::boost::rational<IntType> (min)() BOOST_NOEXCEPT |
| | 715 | { |
| | 716 | return ::boost::rational<IntType>( |
| | 717 | 1, |
| | 718 | (::std::numeric_limits<IntType>::max)()); |
| | 719 | } |
| | 720 | // Add #ifndef BOOST_NO_CXX11_NUMERIC_LIMITS ? |
| | 721 | static BOOST_CONSTEXPR ::boost::rational<IntType> lowest() BOOST_NOEXCEPT |
| | 722 | { |
| | 723 | return ::boost::rational<IntType>( |
| | 724 | (::std::numeric_limits<IntType>::min)(), // or -(::std::numeric_limits<IntType>::max)() ? |
| | 725 | (::std::numeric_limits<IntType>::max)()); |
| | 726 | } |
| | 727 | static BOOST_CONSTEXPR ::boost::rational<IntType> (max)() BOOST_NOEXCEPT |
| | 728 | { |
| | 729 | return ::boost::rational<IntType>( |
| | 730 | (::std::numeric_limits<IntType>::max)(), |
| | 731 | 1); |
| | 732 | } |
| | 733 | static BOOST_CONSTEXPR ::boost::rational<IntType> epsilon() BOOST_NOEXCEPT |
| | 734 | { |
| | 735 | return ::boost::rational<IntType>( |
| | 736 | 1, |
| | 737 | (::std::numeric_limits<IntType>::max)()); |
| | 738 | } |
| | 739 | static BOOST_CONSTEXPR ::boost::rational<IntType> denorm_min() BOOST_NOEXCEPT |
| | 740 | { |
| | 741 | return ::boost::rational<IntType>( |
| | 742 | 1, |
| | 743 | (::std::numeric_limits<IntType>::max)()); |
| | 744 | } |
| | 745 | static BOOST_CONSTEXPR ::boost::rational<IntType> round_error() BOOST_NOEXCEPT |
| | 746 | { |
| | 747 | return ::boost::rational<IntType>(1, 1); |
| | 748 | } |
| | 749 | static BOOST_CONSTEXPR ::boost::rational<IntType> infinity() BOOST_NOEXCEPT |
| | 750 | { |
| | 751 | return ::boost::rational<IntType>(0, 1); |
| | 752 | } |
| | 753 | static BOOST_CONSTEXPR ::boost::rational<IntType> quiet_NaN() BOOST_NOEXCEPT |
| | 754 | { |
| | 755 | return ::boost::rational<IntType>(0, 1); |
| | 756 | } |
| | 757 | static BOOST_CONSTEXPR ::boost::rational<IntType> signaling_NaN() BOOST_NOEXCEPT |
| | 758 | { |
| | 759 | return ::boost::rational<IntType>(0, 1); |
| | 760 | } |
| | 761 | }; |
| | 762 | |
| | 763 | } // namespace std |
| | 764 | |