[erlang-questions] binary elements greater than 255
Sat Apr 26 07:39:37 CEST 2008
> >> I know that lately computer industry decided to switch from 6-bit to
> >> bytes :), which when unsigned can hold values in range 0..255. But
> >> wasn't my question. I asked, why Erlang compiler didn't return error,
> >> you give it input like <<256>>. I think it's a bug.
> >> Zvi
I hope I am not the only person but I think this is the exact right
behavior. If you over flow a binary digit it rolls over, in many cases
this an intended behavior. Now why an int isn't 4 bytes instead of 1 that
does seem a bit wrong, but not to shocking.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions