<p><br>
On Mar 18, 2012 3:09 PM, "Manu" <<a href="mailto:turkeyman@gmail.com">turkeyman@gmail.com</a>> wrote<br>
> int x = 123456;<br>
> x &= 0xFF; // x is now in range 0..255; now fits in a ubyte<br>
> ubyte y = x; // assign silently, cast can safely be implicit</p>
<p>This is related to Go's infinitely sized constants.  If an expression produces a value out of range then brings it back in range in a constant it still works.</p>
<p>int i = 1 << 100 >> 98;<br>
assert( i == 4);</p>
<p>Not exactly related but similar idea.  </p>