[Bug 171] >>>= broken with short integers
via D.gnu
d.gnu at puremagic.com
Sat Jan 17 03:18:31 PST 2015
http://bugzilla.gdcproject.org/show_bug.cgi?id=171
--- Comment #1 from Iain Buclaw <ibuclaw at gdcproject.org> ---
Problem is that in the operation:
a = a >> 1;
'a' is promoted to an unsigned integer for normal operations before the final
result being downcasted back.
So we get the following sequence.
a => -1
cast(uint) => 4294967295
a >> 1 => 2147483647
cast(short) => -1
--
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20150117/2faef536/attachment.html>
More information about the D.gnu
mailing list