www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/04/18:45:58

From: "John S. Fine" <johnfine AT erols DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Possible bit shifting bug ...
Date: Tue, 04 Aug 1998 18:35:35 -0400
Organization: RCN Internet
Message-ID: <35C78CB7.5D9A@erols.com>
References: <000601bdbff2$503f04a0$1901030a AT WS-hkatirai DOT netpartners DOT com>
Reply-To: johnfine AT erols DOT com
NNTP-Posting-Host: 207-172-240-103.s40.as2.bsd.erols.com
Mime-Version: 1.0
Lines: 13
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hooman Katirai wrote:

>                         j << 1;

> The output is only a series of '1's. No bitshifting ever took place.

  Because you didn't tell it to store the result anywhere.

  You should have used  j <<= 1;  which has the effect of
j = j << 1;
-- 
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019