Difference between revisions of "Shr"

From Lazarus wiki
Jump to navigationJump to search
(New page: '''Sh'''ift '''r'''ight (shr) performs a right bit-shift operation.)
 
Line 1: Line 1:
'''Sh'''ift '''r'''ight (shr) performs a right bit-shift operation.
+
'''Sh'''ift '''r'''ight (shr) performs a right bit-shift operation (opposite than [[Shl|shl]]).
 +
 
 +
 
 +
 
 +
== Is a bit set ==
 +
 
 +
<delphi>
 +
function isBitSet(AValue, ABitNumber:integer):boolean;
 +
begin
 +
  result:=odd(AValue shr ABitNumber);
 +
end;
 +
</delphi>
 +
 
 +
=== Read more ===
 +
* [[Odd]]
 +
* [[Boolean]]
 +
* [[Const]]
 +
* [[Function]]
 +
* [[Integer]]

Revision as of 22:17, 8 November 2007

Shift right (shr) performs a right bit-shift operation (opposite than shl).


Is a bit set

<delphi> function isBitSet(AValue, ABitNumber:integer):boolean; begin

  result:=odd(AValue shr ABitNumber);

end; </delphi>

Read more