File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/main/java/com/conversions Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public class BinaryToHexadecimal {
12
12
* @return The hexadecimal number
13
13
*/
14
14
15
- public String binToHex (int binary ) {
15
+ public String binToHex (long binary ) {
16
16
//hm to store hexadecimal codes for binary numbers within the range: 0000 to 1111 i.e. for decimal numbers 0 to 15
17
17
HashMap <Integer ,String > hmHexadecimal = new HashMap <>();
18
18
@@ -25,7 +25,7 @@ public String binToHex(int binary) {
25
25
for (i =10 ; i <16 ; i ++)
26
26
hmHexadecimal .put (i ,String .valueOf ((char )('A' +i -10 )));
27
27
28
- int currentbit ;
28
+ long currentbit ;
29
29
while (binary != 0 ) {
30
30
int code4 = 0 ; //to store decimal equivalent of number formed by 4 decimal digits
31
31
for (i =0 ; i <4 ; i ++)
You can’t perform that action at this time.
0 commit comments