Explicitly cast result of Math.pow to int in BinaryToHexadecimal (#4970)

This commit is contained in:
Piotr Idzik
2023-11-29 22:30:59 +01:00
committed by GitHub
parent 361b4108ee
commit f8de290188

View File

@ -34,7 +34,7 @@ public class BinaryToHexadecimal {
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
currbit = binary % 10; currbit = binary % 10;
binary = binary / 10; binary = binary / 10;
code4 += currbit * Math.pow(2, i); code4 += currbit * (int) Math.pow(2, i);
} }
hex = hm.get(code4) + hex; hex = hm.get(code4) + hex;
} }