Leave decltype(max_ulps_) alone and cast, not sure this is better

This commit is contained in:
Mark Mentovai 2015-11-11 17:44:12 -05:00
parent 322a4914a3
commit cbce23fb86

View File

@ -2708,19 +2708,21 @@ class FloatingPointTest : public testing::Test {
zero_bits_(Floating(0).bits()),
one_bits_(Floating(1).bits()),
infinity_bits_(Floating(Floating::Infinity()).bits()),
close_to_positive_zero_(
Floating::ReinterpretBits(zero_bits_ + max_ulps_/2)),
close_to_negative_zero_(
-Floating::ReinterpretBits(zero_bits_ + max_ulps_ - max_ulps_/2)),
close_to_positive_zero_(Floating::ReinterpretBits(
static_cast<Bits>(zero_bits_ + max_ulps_/2))),
close_to_negative_zero_(-Floating::ReinterpretBits(
static_cast<Bits>(zero_bits_ + max_ulps_ - max_ulps_/2))),
further_from_negative_zero_(-Floating::ReinterpretBits(
zero_bits_ + max_ulps_ + 1 - max_ulps_/2)),
close_to_one_(Floating::ReinterpretBits(one_bits_ + max_ulps_)),
further_from_one_(Floating::ReinterpretBits(one_bits_ + max_ulps_ + 1)),
static_cast<Bits>(zero_bits_ + max_ulps_ + 1 - max_ulps_/2))),
close_to_one_(Floating::ReinterpretBits(
static_cast<Bits>(one_bits_ + max_ulps_))),
further_from_one_(Floating::ReinterpretBits(
static_cast<Bits>(one_bits_ + max_ulps_ + 1))),
infinity_(Floating::Infinity()),
close_to_infinity_(
Floating::ReinterpretBits(infinity_bits_ - max_ulps_)),
further_from_infinity_(
Floating::ReinterpretBits(infinity_bits_ - max_ulps_ - 1)),
close_to_infinity_(Floating::ReinterpretBits(
static_cast<Bits>(infinity_bits_ - max_ulps_))),
further_from_infinity_(Floating::ReinterpretBits(
static_cast<Bits>(infinity_bits_ - max_ulps_ - 1))),
max_(Floating::Max()),
nan1_(Floating::ReinterpretBits(Floating::kExponentBitMask | 1)),
nan2_(Floating::ReinterpretBits(Floating::kExponentBitMask | 200)) {
@ -2778,7 +2780,7 @@ class FloatingPointTest : public testing::Test {
// Pre-calculated numbers to be used by the tests.
const unsigned int max_ulps_;
const size_t max_ulps_;
const Bits zero_bits_; // The bits that represent 0.0.
const Bits one_bits_; // The bits that represent 1.0.