We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Math.pow
int
BinaryToHexadecimal
1 parent 361b410 commit f8de290Copy full SHA for f8de290
src/main/java/com/thealgorithms/conversions/BinaryToHexadecimal.java
@@ -34,7 +34,7 @@ static String binToHex(int binary) {
34
for (i = 0; i < 4; i++) {
35
currbit = binary % 10;
36
binary = binary / 10;
37
- code4 += currbit * Math.pow(2, i);
+ code4 += currbit * (int) Math.pow(2, i);
38
}
39
hex = hm.get(code4) + hex;
40
0 commit comments