summaryrefslogtreecommitdiff
path: root/absl/numeric
diff options
context:
space:
mode:
authorGravatar Derek Mauro <dmauro@google.com>2023-03-30 12:09:23 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-03-30 12:10:15 -0700
commitd79361faf639618b501312a5dcdefeaa5bbadfd8 (patch)
tree123223f316f3c7064ec4919271643bfcd6b0beb4 /absl/numeric
parent2d31912897d4b4a72424368154d37f05c93677cb (diff)
Changes necessary to support clang-cl
This change fixes -Wimplicit-const-int-float-conversion warnings by making the conversions explicit. PiperOrigin-RevId: 520707623 Change-Id: Ib6917469120cd7458257195cbf39beb3fd397543
Diffstat (limited to 'absl/numeric')
-rw-r--r--absl/numeric/int128_test.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/absl/numeric/int128_test.cc b/absl/numeric/int128_test.cc
index a6fed5cf..01e3eb5c 100644
--- a/absl/numeric/int128_test.cc
+++ b/absl/numeric/int128_test.cc
@@ -285,8 +285,9 @@ TEST(Uint128, ConversionTests) {
EXPECT_EQ(from_precise_double, from_precise_ints);
EXPECT_DOUBLE_EQ(static_cast<double>(from_precise_ints), precise_double);
- double approx_double = 0xffffeeeeddddcccc * std::pow(2.0, 64.0) +
- 0xbbbbaaaa99998888;
+ double approx_double =
+ static_cast<double>(0xffffeeeeddddcccc) * std::pow(2.0, 64.0) +
+ static_cast<double>(0xbbbbaaaa99998888);
absl::uint128 from_approx_double(approx_double);
EXPECT_DOUBLE_EQ(static_cast<double>(from_approx_double), approx_double);