40> <<A:16>> = <<1,2>>.
<<1,2>>
41> <<B:16/bits>> = <<1,2>>.
<<1,2>>
42> <<A:16>> = << B:16/bits>>.//-----------数值相等的两个变量相等--------------------------------------------
<<1,2>>
43> <<A:16>> = << A:16/bits>>.   //-----------同一变量缺少默认值单位的和带上默认值单位的不相等。--------------------------------------------
** exception error: bad argument
44> <<A:16/bits>> = << A:16/bits>>.
** exception error: bad argument
45> <<A:16>> = << A:16>>.          
<<1,2>>
46> <<B:16>> = <<B:16>>.
** exception error: bad argument
47> <<B:16/bits>> = <<B:16>>.
** exception error: bad argument
48> <<B:16>> = <<B:16/bits>>.
** exception error: no match of right hand side value <<1,2>>
49> <<B:2/unit:8>> = <<B:16/bits>>.
** exception error: no match of right hand side value <<1,2>>
50> <<C:2/unit:8>> = <<B:16/bits>>.
<<1,2>>
51> <<D:1/unit:16>> = <<B:16/bits>>.
<<1,2>>

 

51> <<Length:32/big-unsigned-integer,OneInt:1/big-unsigned-integer-unit:32,StrLength:16,Left/binary>> = Bin.

52>    <<"aa","bb">>.
<<"aabb">>
53> <<"aa",Left/binary>> = <<"aa123">>.
<<"aa123">>

 

 

erlang二进制的难理解的地方,有点神奇

erlang二进制的难理解的地方,有点神奇

 

 

相关文章:

  • 2021-11-13
  • 2022-01-09
  • 2021-08-07
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2021-06-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案