[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
operator shr (operand1, operand2: integer type) = Result: integer type; |
procedure shr (var operand1: integer type; operand2: integer type); |
In GNU Pascal, `shr' has two built-in meanings:
`shr' is a Borland Pascal extension.
Unlike the Borland compilers, GNU Pascal cares about the signedness of the first operand: If a signed integer with a negative value is shifted right, "one" bits are filled in from the left.
Use of `shr' as a "procedure" is a GNU Pascal extension.
program ShrDemo; var a: Integer; begin a := 1024 shr 4; { yields 64 } a := -127 shr 4; { yields -8 } shr (a, 2) { same as `a := a shr 2' } end. |
section 9.248 shl, section 8.3 Operators.