Delphi中取某整数的某位的位状态的小函数

作者:互联网

2025-08-15

Delphi教程

type

TPosRange=0..32;

TStateResult=0..1;

function GetBitSate(Source:Integer;Pos:TPosRange):TStateResult;

begin

Result:=((Source and (1 shl Pos))shr Pos);

end;

相关标签:

Delphi教程