601. [dec.tr] numeric_limits typos

Section: 99 [dec.tr::trdec.types.limits] Status: TRDec Submitter: Daniel Krugler Opened: 2006-05-28 Last modified: 2016-02-10

Priority: Not Prioritized

View all issues with TRDec status.

Discussion:

Daniel writes in a private email:

- 3.3 'Additions to header <limits>' contains two errors in the specialisation of numeric_limits<decimal::decimal128>:

  1. The static member max() returns DEC128_MIN, this should be DEC128_MAX.
  2. The static member digits is assigned to 384, this should be 34 (Probably mixed up with the max. exponent for decimal::decimal64).

Proposed resolution:

In "3.3 Additions to header <limits>" change numeric_limits<decimal::decimal128> as follows:

        template<> class numeric_limits<decimal::decimal128> {
          public:
            static const bool is_specialized = true;

            static decimal::decimal128 min() throw() { return DEC128_MIN; }
            static decimal::decimal128 max() throw() { return DEC128_MIN; DEC128_MAX; }

            static const int digits       = 384 34;
            /* ... */