<div dir="ltr"><div>It depends.... the ultimate weasel answer :-).<br><br></div>I get a compilation error because I always compile with -Wall -Werror. SInce everyone should be doing that (my decree) that is the ultimate answer.<br><br><div><br>gcc bigshift.c -o bigshift -Wall -Werror<br>bigshift.c: In function ‘main’:<br>bigshift.c:5:29: error: left shift count >= width of type [-Werror=shift-count-overflow]<br>   printf("%d\n", 0xFFFFFFFF << 34);<br>                             ^<br>cc1: all warnings being treated as errors<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 26, 2017 at 10:52 AM, Mark Atherton <span dir="ltr"><<a href="mailto:markaren1@xtra.co.nz" target="_blank">markaren1@xtra.co.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>

    
<div>Doesn't it depend on what 'a' is declared as, and the language ?<br><br>Assuming C, and if 'a' was a U32, and 0xFFFFFFFF was 0xFFFFFFFFL, and 34 was 34L, then possibly the answer might, perhaps, possibly be 0.<br><br>having said that, given the context of the question and the person asking the question, I smell an odorous rodent :)<br><br>-Mark<br><br><a href="http://www.c4learn.com/c-programming/c-bitwise-left-shift-operator/" target="_blank">http://www.c4learn.com/c-<wbr>programming/c-bitwise-left-<wbr>shift-operator/</a> ties up with my understanding, but again I may need more anti-paranoia medication...<div><div class="h5"><br>
<br><blockquote type="cite">
On 26 April 2017 at 10:04 hamster <<a href="mailto:hamster@snap.net.nz" target="_blank">hamster@snap.net.nz</a>> wrote:<br><br>
<p>Sorry - no chocolate fish this time</p>
<p>What is the value of a?</p>
<p>  a = 0xFFFFFFFF << 34;</p>
<p>Have you checked your answer?</p>
<p> </p>
<p> </p>
<div> </div>
</blockquote>
<br> </div></div><blockquote type="cite">

______________________________<wbr>_________________<br>Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.linuxnut.co.nz" target="_blank">Chchrobotics@lists.linuxnut.<wbr>co.nz</a><br><a href="http://lists.ourshack.com/mailman/listinfo/chchrobotics" target="_blank">http://lists.ourshack.com/<wbr>mailman/listinfo/chchrobotics</a><br>Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" target="_blank">http://lists.ourshack.com/<wbr>pipermail/chchrobotics/</a><br>Meetings usually 3rd Monday each month. See <a href="http://kiwibots.org" target="_blank">http://kiwibots.org</a> for venue, directions and dates.<br>When replying, please edit your Subject line to reflect new subjects.</blockquote>
<br> </div>
 <br>______________________________<wbr>_________________<br>
Chchrobotics mailing list <a href="mailto:Chchrobotics@lists.linuxnut.co.nz">Chchrobotics@lists.linuxnut.<wbr>co.nz</a><br>
<a href="http://lists.ourshack.com/mailman/listinfo/chchrobotics" rel="noreferrer" target="_blank">http://lists.ourshack.com/<wbr>mailman/listinfo/chchrobotics</a><br>
Mail Archives: <a href="http://lists.ourshack.com/pipermail/chchrobotics/" rel="noreferrer" target="_blank">http://lists.ourshack.com/<wbr>pipermail/chchrobotics/</a><br>
Meetings usually 3rd Monday each month. See <a href="http://kiwibots.org" rel="noreferrer" target="_blank">http://kiwibots.org</a> for venue, directions and dates.<br>
When replying, please edit your Subject line to reflect new subjects.<br></blockquote></div><br></div>