Re: [Boost-bugs] [Boost C++ Libraries] #13360: std::numeric_limits<multiprecision::float128> methods fail to compile in C++11 mode

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #13360: std::numeric_limits<multiprecision::float128> methods fail to compile in C++11 mode
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-12-28 21:16:49


#13360: std::numeric_limits<multiprecision::float128> methods fail to compile in
C++11 mode
-------------------------------+----------------------------
  Reporter: b7.10110111@… | Owner: John Maddock
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: multiprecision
   Version: Boost 1.66.0 | Severity: Regression
Resolution: | Keywords:
-------------------------------+----------------------------

Comment (by b7.10110111@…):

 Actually, if we want to remain compatible to non-x87 FPUs, supporting
 IEEE754 binary64 as {{{double}}}, then we can do it this way:
 {{{
     constexpr auto max=(__float128(0x1.fffffffffffffp+1023)
                         + 0x1.ffffffffffffp+970 + 0x1.ffcp+921)
                        * 0x1p+1023 * 0x1p+1023 * 0x1p+1023 * 0x1p+1023
                        * 0x1p+1023 * 0x1p+1023 * 0x1p+1023 * 0x1p+1023
                        * 0x1p+1023 * 0x1p+1023 * 0x1p+1023 * 0x1p+1023
                        * 0x1p+1023 * 0x1p+1023 * 0x1p+1023 * 0x1p+15;
     constexpr auto min=__float128(0x1p-1022) * 0x1p-1022
                        * 0x1p-1022 * 0x1p-1022 * 0x1p-1022
                        * 0x1p-1022 * 0x1p-1022 * 0x1p-1022
                        * 0x1p-1022 * 0x1p-1022 * 0x1p-1022
                        * 0x1p-1022 * 0x1p-1022 * 0x1p-1022
                        * 0x1p-1022 * 0x1p-1022 * 0x1p-30;
     constexpr auto denorm_min=__float128(0x1p-1022) * 0x1p-1022
                               * 0x1p-1022 * 0x1p-1022 * 0x1p-1022
                               * 0x1p-1022 * 0x1p-1022 * 0x1p-1022
                               * 0x1p-1022 * 0x1p-1022 * 0x1p-1022
                               * 0x1p-1022 * 0x1p-1022 * 0x1p-1022
                               * 0x1p-1022 * 0x1p-1022 * 0x1p-142;
     constexpr auto epsilon=__float128(0x1p-112);

 assert(max==std::numeric_limits<boost::multiprecision::float128>::max());
 assert(min==std::numeric_limits<boost::multiprecision::float128>::min());
 assert(epsilon==std::numeric_limits<boost::multiprecision::float128>::epsilon());
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13360#comment:4>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-12-28 21:22:20 UTC