您的位置:首页 > 其它

整数显示二进制字符串

2010-12-19 13:11 190 查看
function IntToBin(Value: Integer; Count: Integer = 32): string;
var
iTemp: Integer;
begin
Result := '';
while Count > 0 do
begin
iTemp := Value shr (Count - 1) and 1;
case iTemp of
1:
Result := Result + '1';
0:
Result := Result + '0';
end;
Dec(Count);
end;
end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: