[fpc-devel] Unexpected behaviour of bit operators

wkitty42 at windstream.net wkitty42 at windstream.net
Fri May 17 16:15:01 CEST 2019


On 5/17/19 9:44 AM, J. Gareth Moreton wrote:
> It's a constant set to equal 2^n, or in binary, 1 followed by n zeroes.

ugh! yeah, i see that now... the layout confused me as i'm used to CONST being 
on its own line or prefixed to every constant defined...

eg:
const
   n=12;
   s=1 shl n;

OR

const n=12;
const s=1 shl n;


> P.S. And yes, that mask is also zero-extended to 32-bit or whatever the word 
> size is on the CPU.


-- 
  NOTE: No off-list assistance is given without prior approval.
        *Please keep mailing list traffic on the list unless*
        *a signed and pre-paid contract is in effect with us.*



More information about the fpc-devel mailing list