a.十进制数转换为二进制数
var a = 302;
console.log(a.toString(2));
b.二进制转换为十进制
var b = 1010111;
console.log(parseInt(b,2));
时间: 2024-12-12 05:30:25
a.十进制数转换为二进制数
var a = 302;
console.log(a.toString(2));
b.二进制转换为十进制
var b = 1010111;
console.log(parseInt(b,2));