Skip to content

Commit

Permalink
Fix min/max_exponent values (these should be base 10 not base 2 as be…
Browse files Browse the repository at this point in the history
…fore).

[SVN r86778]
  • Loading branch information
jzmaddock committed Nov 21, 2013
1 parent 6840672 commit 25e5455
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/boost/multiprecision/cpp_dec_float.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ class cpp_dec_float
static const boost::int32_t cpp_dec_float_digits10 = ((cpp_dec_float_digits10_setting < cpp_dec_float_digits10_limit_lo) ? cpp_dec_float_digits10_limit_lo : ((cpp_dec_float_digits10_setting > cpp_dec_float_digits10_limit_hi) ? cpp_dec_float_digits10_limit_hi : cpp_dec_float_digits10_setting));
static const ExponentType cpp_dec_float_max_exp10 = (static_cast<ExponentType>(1) << (std::numeric_limits<ExponentType>::digits - 5));
static const ExponentType cpp_dec_float_min_exp10 = -cpp_dec_float_max_exp10;
static const ExponentType cpp_dec_float_max_exp = static_cast<ExponentType>((cpp_dec_float_max_exp10 / 301LL) * 1000LL);
static const ExponentType cpp_dec_float_min_exp = static_cast<ExponentType>((cpp_dec_float_min_exp10 / 301LL) * 1000LL);
static const ExponentType cpp_dec_float_max_exp = cpp_dec_float_max_exp10;
static const ExponentType cpp_dec_float_min_exp = cpp_dec_float_min_exp10;

BOOST_STATIC_ASSERT((cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_max_exp10 == -cpp_dec_float<Digits10, ExponentType, Allocator>::cpp_dec_float_min_exp10));

Expand Down

0 comments on commit 25e5455

Please sign in to comment.