From 8d3634933b919a4ea061a7e11e1fa57448f6d7a5 Mon Sep 17 00:00:00 2001 From: David Schlosnagle Date: Thu, 22 Sep 2022 12:14:40 -0400 Subject: [PATCH] Address FloatCast warnings --- .../HumanReadableByteCountTests.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/human-readable-types/src/test/java/com/palantir/humanreadabletypes/HumanReadableByteCountTests.java b/human-readable-types/src/test/java/com/palantir/humanreadabletypes/HumanReadableByteCountTests.java index 8d5c2d2a7..d98b16e4b 100644 --- a/human-readable-types/src/test/java/com/palantir/humanreadabletypes/HumanReadableByteCountTests.java +++ b/human-readable-types/src/test/java/com/palantir/humanreadabletypes/HumanReadableByteCountTests.java @@ -44,32 +44,27 @@ public void testParseKibiBytes() { @Test public void testParseMibiBytes() { - assertStringsEqualToBytes( - (long) Math.pow((double) 1024L, (double) 2L) * 10L, "10m", "10mb", "10 mibibyte", "10 mibibytes"); + assertStringsEqualToBytes((long) (Math.pow(1024.0, 2.0) * 10.0), "10m", "10mb", "10 mibibyte", "10 mibibytes"); } @Test public void testParseMebiBytes() { - assertStringsEqualToBytes( - (long) Math.pow((double) 1024L, (double) 2L) * 10L, "10m", "10mb", "10 mebibyte", "10 mebibytes"); + assertStringsEqualToBytes((long) (Math.pow(1024.0, 2.0) * 10.0), "10m", "10mb", "10 mebibyte", "10 mebibytes"); } @Test public void testParseGibiBytes() { - assertStringsEqualToBytes( - (long) Math.pow((double) 1024L, (double) 3L) * 10L, "10g", "10gb", "10 gibibyte", "10 gibibytes"); + assertStringsEqualToBytes((long) (Math.pow(1024.0, 3.0) * 10.0), "10g", "10gb", "10 gibibyte", "10 gibibytes"); } @Test public void testParseTebiBytes() { - assertStringsEqualToBytes( - (long) Math.pow((double) 1024L, (double) 4L) * 10L, "10t", "10tb", "10 tebibyte", "10 tebibytes"); + assertStringsEqualToBytes((long) (Math.pow(1024.0, 4.0) * 10.0), "10t", "10tb", "10 tebibyte", "10 tebibytes"); } @Test public void testParsePebiBytes() { - assertStringsEqualToBytes( - (long) Math.pow((double) 1024L, (double) 5L) * 10L, "10p", "10pb", "10 pebibyte", "10 pebibytes"); + assertStringsEqualToBytes((long) (Math.pow(1024.0, 5.0) * 10.0), "10p", "10pb", "10 pebibyte", "10 pebibytes"); } @Test