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.
1 parent 6268d39 commit 2bcc4c9Copy full SHA for 2bcc4c9
src/main/java/com/conversions/BinaryToHexadecimal.java
@@ -12,7 +12,7 @@ public class BinaryToHexadecimal {
12
* @return The hexadecimal number
13
*/
14
15
- public String binToHex(int binary) {
+ public String binToHex(long binary) {
16
//hm to store hexadecimal codes for binary numbers within the range: 0000 to 1111 i.e. for decimal numbers 0 to 15
17
HashMap<Integer,String> hmHexadecimal = new HashMap<>();
18
@@ -25,7 +25,7 @@ public String binToHex(int binary) {
25
for(i=10 ; i<16 ; i++)
26
hmHexadecimal.put(i,String.valueOf((char)('A'+i-10)));
27
28
- int currentbit;
+ long currentbit;
29
while(binary != 0) {
30
int code4 = 0; //to store decimal equivalent of number formed by 4 decimal digits
31
for(i=0 ; i<4 ; i++)
0 commit comments