diff options
author | Steve Robbins <steve@sumost.ca> | 2023-07-04 02:23:18 (GMT) |
---|---|---|
committer | Steve Robbins <steve@sumost.ca> | 2023-07-04 02:23:18 (GMT) |
commit | 3044657e7afa759ce875a8161cd4bff0fd2e22bc (patch) | |
tree | e411c1b7595652eaea3d3f1c0d1d92966d08c2c9 /googletest | |
parent | be03d00f5f0cc3a997d1a368bee8a1fe93651f48 (diff) | |
download | googletest-3044657e7afa759ce875a8161cd4bff0fd2e22bc.zip googletest-3044657e7afa759ce875a8161cd4bff0fd2e22bc.tar.gz googletest-3044657e7afa759ce875a8161cd4bff0fd2e22bc.tar.bz2 |
Use template type FloatType in the cast.refs/pull/4308/head
Diffstat (limited to 'googletest')
-rw-r--r-- | googletest/include/gtest/gtest-printers.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/googletest/include/gtest/gtest-printers.h b/googletest/include/gtest/gtest-printers.h index 9a765fd..e69a0a6 100644 --- a/googletest/include/gtest/gtest-printers.h +++ b/googletest/include/gtest/gtest-printers.h @@ -531,7 +531,7 @@ int AppropriateResolution(FloatType val) { } else if (val >= 0.0001) { mulfor6 = 1e9; } - if (static_cast<float>(static_cast<int32_t>(val * mulfor6 + 0.5)) / + if (static_cast<FloatType>(static_cast<int32_t>(val * mulfor6 + 0.5)) / mulfor6 == val) return 6; @@ -546,7 +546,7 @@ int AppropriateResolution(FloatType val) { } else if (val >= 1e6) { // 1,000,000 to 9,999,999 divfor6 = 10; } - if (static_cast<float>(static_cast<int32_t>(val / divfor6 + 0.5)) * + if (static_cast<FloatType>(static_cast<int32_t>(val / divfor6 + 0.5)) * divfor6 == val) return 6; |