主题:最牛的十进制转二进制程序
[font=宋体]
FUNCTION DecBin$ (Dec AS LONG)
CONST bMagic = "0000101001101111000", hMagic = "ABCHFDILPGEKOJNM"
DIM D AS LONG
D = Dec
B$ = ""
DO
B$ = MID$(bMagic, ASC(MID$(hMagic, D MOD 16 + 1, 1)) - 64, 4) + B$
D = D \ 16
LOOP UNTIL D = 0
DecBin$ = B$
END FUNCTION
[/font]
FUNCTION DecBin$ (Dec AS LONG)
CONST bMagic = "0000101001101111000", hMagic = "ABCHFDILPGEKOJNM"
DIM D AS LONG
D = Dec
B$ = ""
DO
B$ = MID$(bMagic, ASC(MID$(hMagic, D MOD 16 + 1, 1)) - 64, 4) + B$
D = D \ 16
LOOP UNTIL D = 0
DecBin$ = B$
END FUNCTION
[/font]