binary: -1 versus 255

Willem Broekema willem@REDACTED
Fri Jul 18 18:02:07 CEST 2003


Is this a bug in binary matching?

6> << -1 >>.
<<255>>
7> << -1 >> = << 255 >>.   % I expected this to match
** exited: {{badmatch,<<255>>},
             [{erl_eval,expr,3}]} **
8> A = << -1 >>.
<<255>>
9> << 255 >> = A.
<<255>>


- Willem




More information about the erlang-questions mailing list