develooper Front page | perl.perl5.porters | Postings from June 2015

Re: Coverity finding: shift by negative

Thread Previous | Thread Next
From:
Jan Dubois
Date:
June 23, 2015 05:02
Subject:
Re: Coverity finding: shift by negative
Message ID:
CAD-TLz_W18iwhrniP61nS5dqyRMhX50dJvge5Eq0MSsgcPO-xA@mail.gmail.com
On Mon, Jun 22, 2015 at 5:58 PM, Jan Dubois <jand@activestate.com> wrote:
> The modulo operation would turn the shift into a rotate, which should
> be a separate operator. Of course for rotation using negative numbers
> to change direction makes even more sense.

Actually, this part of my statement is wrong; it wouldn't be a
rotation. But shifting by "n modulo wordbits" makes even less sense to
me now that I thought about it again. Why would this ever be desirable
behaviour?

Cheers,
-Jan

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About