<div dir="ltr">According to my understanding of the documentation (Programming Examples), this is correct behavior.<br><br>1. Default integer size is 8 bits if unspecified.<br>2. If more data than the size specified is provided, it will be truncated to the least significant bits. So 01020304 becomes 04 (8 bits).<br>
<br>I had originally reported this as a bug, but was told it is a feature. There is an EEP to provide a compile-tme option to throw an exception if the truncation is going to happen.<br><br>Sorry you were bitten by this one, too.<br>
<br><div class="gmail_quote">On Thu, Oct 16, 2008 at 7:47 AM, Serge Aleynikov <span dir="ltr"><<a href="mailto:saleyn@gmail.com">saleyn@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Expected:<br>
<br>
1> <<(16#01020304):32/integer>>.<br>
<<1,2,3,4>><br>
2> <<16909060/integer>>.<br>
* 3: syntax error before: '<<'<br>
<br>
Unexpected:<br>
<br>
1> <<16#01020304/integer>>.<br>
<<4>><br>
2> <<(16#01020304)/integer>>.<br>
<<4>><br>
<br>
Serge<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
<br>
</blockquote></div><br></div>