本文整理自网络,侵删。
function DecToBinStr(N: Integer): string;var S: string; i: Integer; Negative: Boolean;begin Negative := False; if N < 0 then Negative := True; N := Abs(N); for i := 1 to SizeOf(N) * 8 do begin if N < 0 then S := S + '1' else S := S + '0'; N := N shl 1; end; Delete(S, 1, Pos('1', S) - 1); if Negative then S := '-' + S; Result := S;end;
相关阅读 >>
Delphi通过spcomm com口发短信包括pud编码解码
Delphi 10.3.3 启动cnpack ide 专家 cnwizards coreide260.bpl错误解决办法
更多相关阅读请进入《Delphi》频道 >>