help-gplusplus
[Top][All Lists]
Advanced

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

Bit shift by more than word length


From: Lionel B
Subject: Bit shift by more than word length
Date: Thu, 14 Jun 2007 11:03:45 GMT
User-agent: Pan/0.127 (Eckythump)

Hi,

If x is of (unsigned) integer type of size N then the C++ standard says 
that x << n and x >> n are undefined for n >= N. Is there by any chance a 
GNU extension that guarantees that at least x << N and x >> N are defined 
(and = 0)?

The reason this would be helpful for me is that I have some very low-
level time-critical code for which I would like to avoid having to treat 
n = N as a special case requiring a test and branch.

Thanks,



-- 
Lionel B


reply via email to

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