Hello, If you need to convert the interger to binary then by using Javasript you can perform it very fast, Let see the example below:-
var binary = (56 >>> 0).toString(2);
console.log(binary);
console.log(parseInt(binary, 2) >> 0);
OutPut:-
1100011 //binary
99 //integer
Now you can make it able to use in function dynamic:-
function decimalTobinary(yourdec){
return (yourdec >>> 0).toString(2);
}
Now you can use this as anywhere and its works perfect.
0 Comment(s)