octave-maintainers
[Top][All Lists]
Advanced

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

Re: bitshift of int8, int16, etc?


From: John W. Eaton
Subject: Re: bitshift of int8, int16, etc?
Date: Mon, 25 Jun 2007 20:00:10 -0400

On 25-Jun-2007, Daniel J Sebald wrote:

| I get your point, but that example is fraught with all kinds of
| compiler casts.  The (x << 1) is probably cast to a regular int
| first and then bit shifted.

Yes, that was my point (and it is promoted to int as required by the
C rules for usual arithmetic conversions, so you can remove probably
from the above).

Since no other operations on the intX types in Octave/Matlab do that
kind of promotion, I don't think we should do it for these either.  So
there is one immediate difference between how C behaves and how it
seems Octave should for the same operator.

jwe


reply via email to

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