From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <003c01c10ddb$248d6650$3cf7c6d4@SOMA> From: "Boyd Roberts" To: <9fans@cse.psu.edu> References: <200107140326.f6E3Q7j03750@ducky.net> <3B512D07.97B5B213@null.net> Subject: Re: [9fans] another compiler bug (another try to send this coherently) MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Date: Mon, 16 Jul 2001 11:38:59 +0200 Topicbox-Message-UUID: ceb2516a-eac9-11e9-9e20-41e7f4b1d025 > printf("%d %d\n", tab[0] << 24 >> 31, x << 24 >> 31); i really don't understand what the problem is here. it's very simple (not that i have a copy of k&r 2 or the standard with me). shifting stuff: - verify what you're shifting [signed/unsigned] - if it's signed, watch out for setting the sign bit - shifts that cause over/under-flow may ruin your whole day - when in doubt, _read_ the doc if you'd like to see some bit mangling code, read: http://www.planete.net/~boyd/code/des.msg