Skip to content

Commit cc36671

Browse files
Merge pull request #4308 from smr99:fix-float-cast
PiperOrigin-RevId: 547250378 Change-Id: I084c30e45f331cb296535822923da1cb7e848e11
2 parents 4a1a299 + 3044657 commit cc36671

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

googletest/include/gtest/gtest-printers.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ int AppropriateResolution(FloatType val) {
531531
} else if (val >= 0.0001) {
532532
mulfor6 = 1e9;
533533
}
534-
if (static_cast<float>(static_cast<int32_t>(val * mulfor6 + 0.5)) /
534+
if (static_cast<FloatType>(static_cast<int32_t>(val * mulfor6 + 0.5)) /
535535
mulfor6 ==
536536
val)
537537
return 6;
@@ -546,7 +546,7 @@ int AppropriateResolution(FloatType val) {
546546
} else if (val >= 1e6) { // 1,000,000 to 9,999,999
547547
divfor6 = 10;
548548
}
549-
if (static_cast<float>(static_cast<int32_t>(val / divfor6 + 0.5)) *
549+
if (static_cast<FloatType>(static_cast<int32_t>(val / divfor6 + 0.5)) *
550550
divfor6 ==
551551
val)
552552
return 6;

0 commit comments

Comments
 (0)