This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: portable signed right shift
- To: gcc at gcc dot gnu dot org
- Subject: Re: portable signed right shift
- From: Ross Smith <ross dot s at ihug dot co dot nz>
- Date: Thu, 29 Mar 2001 07:51:29 +1200
- Organization: Ihug
- References: <20010328123151.144FCF28A8@nile.gnat.com>
dewar@gnat.com wrote:
>
> >-1 >> 1 = -1 (where >> denotes an arithmetic shift right)
>
> Note however, that there is nothing in the definition of C that says
> that -1 >> 1 = -1. This is just one possible convention of what you might
> expect this undefined operator to do.
There's nothing in the definition of C that says that -1 / 2 = 0 either,
for that matter.
--
Ross Smith <ross.s@ihug.co.nz> The Internet Group, Auckland, New Zealand
========================================================================
"Hungarian notation is the tactical nuclear weapon of
source code obfuscation techniques." -- Roedy Green