Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function IntToBin(i:Int64; bits:Int32=8): String; //bits:8,16,32,64
- var c:Int8;
- begin
- for c:=bits-1 downto 0 do
- Result += ToStr((i shr c) and 1);
- end;
- begin
- WriteLn('>> ', IntToBin(13));
- WriteLn('>> ', IntToBin(34));
- WriteLn('>> ', IntToBin(13 or 34));
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement