Skip to content

Commit f8de290

Browse files
authored
Explicitly cast result of Math.pow to int in BinaryToHexadecimal (TheAlgorithms#4970)
1 parent 361b410 commit f8de290

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/thealgorithms/conversions/BinaryToHexadecimal.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static String binToHex(int binary) {
3434
for (i = 0; i < 4; i++) {
3535
currbit = binary % 10;
3636
binary = binary / 10;
37-
code4 += currbit * Math.pow(2, i);
37+
code4 += currbit * (int) Math.pow(2, i);
3838
}
3939
hex = hm.get(code4) + hex;
4040
}

0 commit comments

Comments
 (0)