WEB开发网      濂界珯濂藉垎浜紒浣犵殑涓€浠藉垎浜槸鎴戜滑鐨勪竴浠藉姩鍔涳紱璇峰垎浜� ---锕�
开发学院软件开发Delphi Delphi中取某整数的某位的位状态的小函数 阅读

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

 2006-02-04 13:48:54 来源:WEB开发网 銆�鍑忓皬瀛椾綋澧炲ぇ瀛椾綋銆�  鍏虫敞鏉ㄦ亽椋炵殑寰崥
核心提示:type TPosRange=0..32;TStateResult=0..1;function GetBitSate(Source:Integer;Pos:TPosRange):TStateResult;begin Result:=((Source and (1 shl Pos))shr Pos);end;

type

  TPosRange=0..32;

 TStateResult=0..1;

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

begin

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

end;

Tags:Delphi 整数 某位

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接