diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h index 0055e37f..7d7e77c1 100644 --- a/googletest/include/gtest/gtest-printers.h +++ b/googletest/include/gtest/gtest-printers.h @@ -529,7 +529,10 @@ int AppropriateResolution(FloatType val) { } else if (val >= 0.0001) { mulfor6 = 1e9; } - if (static_cast(val * mulfor6 + 0.5) / mulfor6 == val) return 6; + if (static_cast(static_cast(val * mulfor6 + 0.5)) / + mulfor6 == + val) + return 6; } else if (val < 1e10) { FloatType divfor6 = 1.0; if (val >= 1e9) { // 1,000,000,000 to 9,999,999,999 @@ -541,7 +544,10 @@ int AppropriateResolution(FloatType val) { } else if (val >= 1e6) { // 1,000,000 to 9,999,999 divfor6 = 10; } - if (static_cast(val / divfor6 + 0.5) * divfor6 == val) return 6; + if (static_cast(static_cast(val / divfor6 + 0.5)) * + divfor6 == + val) + return 6; } return full; }