bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fwd: [PATCH] arithmetic -> logical shift]


From: Chet Ramey
Subject: Re: [Fwd: [PATCH] arithmetic -> logical shift]
Date: Sat, 18 Oct 2008 17:04:38 -0400
User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)

Pádraig Brady wrote:
> -------- Original Message --------
> Date: Tue, 07 Oct 2008 11:55:51 +0100
> From: Pádraig Brady <address@hidden>
> To: Chet Ramey <address@hidden>
> CC: address@hidden
> 
> I was just discussing bit shifting with Tim Hockin using shell
> arithmetic expansion, and he pointed out that bash and ksh
> use arithmetic rather than logical shift for the >> operator.

Actually, bash and ksh use whatever the native C compiler implements,
since both just translate the >> and << into the same operators
internally.

I don't see a really compelling reason to change, since, as you say,
the standard requires signed long ints.

> I know the opengroup spec says to use signed ints,
> but I think that is intended to disambiguate input and output,
> rather than defining internal operations.

You might send a message to the austin group asking for an opinion.
That would give you a better sense of the standard's intent.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]