format-inl.h(444,1): warning C4804: '>>': unsafe use of type 'bool' in operation

format.h(2808,1): warning C4127: conditional expression is constant
This commit is contained in:
Ivan Shynkarenka 2019-10-21 11:28:06 +03:00
parent 6498bc6d31
commit 5aa1b4d92a
2 changed files with 2 additions and 2 deletions

View File

@ -441,7 +441,7 @@ class fp {
std::numeric_limits<float>::digits - 1);
if (min_normal_e > e) half_ulp <<= min_normal_e - e;
upper = normalize<0>(fp(f + half_ulp, e));
lower = fp(f - (half_ulp >> (f == implicit_bit && e > min_normal_e)), e);
lower = fp(f - (half_ulp >> ((f == implicit_bit && e > min_normal_e) ? 1 : 0)), e);
lower.f <<= lower.e - upper.e;
lower.e = upper.e;
}

View File

@ -2805,7 +2805,7 @@ void internal::basic_writer<Range>::write_fp(T value,
int precision = specs.precision >= 0 || !specs.type ? specs.precision : 6;
unsigned options = 0;
if (handler.fixed) options |= grisu_options::fixed;
if (sizeof(value) == sizeof(float)) options |= grisu_options::binary32;
if constexpr (sizeof(value) == sizeof(float)) options |= grisu_options::binary32;
bool use_grisu =
USE_GRISU &&
(specs.type != 'a' && specs.type != 'A' && specs.type != 'e' &&