Math;
function IntToBinStr(num: integer): string;
var
i: integer;
begin
for i := 0 to 31 do
Result := IntToStr((num shr i) and 1) + Result;
end;
function BinStrToInt(num: string): integer;
var
i: integer;
begin
Result := 0;
for i := length(num) downto 1 do
Result := Result + strtoint(num[i])*round(Power(2,length(num)-i));
end;
Hiç yorum yok:
Yorum Gönder