erlang比特语法

78> B = << 16#111111115:64/little>> 

78> .

<<21,17,17,17,1,0,0,0>>

79> <<I:64/little>> = B.            

<<21,17,17,17,1,0,0,0>>

80> I.

4581298453

 io_lib:format("~.16b",[I]).
["111111115"]
102> io_lib:format("~.16#",[I]).
[[["16",35],49,49,49,49,49,49,49,49,53]]
103> lists:flatten(io_lib:format("~.16#",[I])).
"16#111111115"

这里还有一个疑问,j结果是list,怎么能得到16#111111115

你可能感兴趣的:(erlang)