Skip to content

Commit 2bcc4c9

Browse files
committed
resolving comment
1 parent 6268d39 commit 2bcc4c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class BinaryToHexadecimal {
1212
* @return The hexadecimal number
1313
*/
1414

15-
public String binToHex(int binary) {
15+
public String binToHex(long binary) {
1616
//hm to store hexadecimal codes for binary numbers within the range: 0000 to 1111 i.e. for decimal numbers 0 to 15
1717
HashMap<Integer,String> hmHexadecimal = new HashMap<>();
1818

@@ -25,7 +25,7 @@ public String binToHex(int binary) {
2525
for(i=10 ; i<16 ; i++)
2626
hmHexadecimal.put(i,String.valueOf((char)('A'+i-10)));
2727

28-
int currentbit;
28+
long currentbit;
2929
while(binary != 0) {
3030
int code4 = 0; //to store decimal equivalent of number formed by 4 decimal digits
3131
for(i=0 ; i<4 ; i++)

0 commit comments

Comments
 (0)