Bill,

Bill Seymour <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I've upload fixdec23.zip to the Yahoo files section.
>
> I made some changes that Jens suggested to allow compiling with
> Comeau and gcc; and I've made the is_bounded and is_modulo fixes
> that Fernando suggested along with interoperatability with
> unsigned as well as int.
>
Great,

> Fernando,
>
> I think that max_scale needs to be a constant expression
> because it's used in the definition of numeric_limits<decimal>:
>
>   BOOST_STATIC_CONSTANT(int, digits=boost::fixdec::max_scale);
>   BOOST_STATIC_CONSTANT(int, digits10=boost::fixdec::max_scale);
>
Couldn't these be implemented right in terms of
numeric_limits<int_type>::digits?

> And I think I'm right about numeric_limits<>::digits10.  I believe
> it's intended to be mean that, if the value is N, then /all/ N-digit
> numbers can be represented.  numeric_limits<decimal>::digits10 can't
> be 19 because only a subset of 19-digit numbers are representable.
>
> Also, I think that your statement:
> >
> > ... __int64 support 18 digits at most.
> >
> is factually incorrect.  Your implementation's __int64 should support
> anything up to 10**63 - 1 or (with commas as thousands separators)
> 9,223,372,036,854,775,807.  That's a 19-digit number.
>

You're right on both accounts.

All numbers with 'N=digits10' digits should be representable, including
N-nines.
That explains why numeric_limits<__int64>::digits10 is 18 even though
numeric_limits<__int64>::max() is a 19 digit number.
The leading digit, being a partial digit, cannot be accounted for in
'digits10'.

Fernando Cacciola




_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to