Logo

Programming-Idioms

History of Idiom 76 > diff from v17 to v18

Edit summary for version 18 by :

Version 17

2015-08-22, 15:43:42

Version 18

2015-08-22, 21:57:19

Idiom #76 Binary digits from an integer

Create the string s of integer x written in base 2.

E.g. 13 -> "1101"

Idiom #76 Binary digits from an integer

Create the string s of integer x written in base 2.

E.g. 13 -> "1101"

Imports
StrUtils;
Code
var
  _x: Integer;
  _s: String;
begin
  _s := IntToBin(_x,8*SizeOf(Integer));
end.
Comments bubble
SizeOf() gives the nr of bytes that type Integer is wide.