Get rid of conversion warning in gcc-4.8 (#854)

Get rid of conversion warning in gcc-4.8 

Get rid of the following warning:
conversion to ‘int’ from ‘long unsigned int’ may alter its value [-Werror=conversion]
This commit is contained in:
medithe 2018-09-11 15:14:39 +02:00 committed by Victor Zverovich
parent 6ffc828a79
commit 8cbfb6e727

View File

@ -371,7 +371,7 @@ class fp {
explicit fp(Double d) {
// Assume double is in the format [sign][exponent][significand].
typedef std::numeric_limits<Double> limits;
const int double_size = sizeof(Double) * char_size;
const int double_size = static_cast<int>(sizeof(Double) * char_size);
const int exponent_size =
double_size - double_significand_size - 1; // -1 for sign
const uint64_t significand_mask = implicit_bit - 1;