As already asked David in a comment of an answer here, I\'m really interested on how this function works, since I can\'t seem to get the same (correct) values if changing re
Personally, I'd do it this way:
function inttobin (p_nb_int: uint64; p_nb_digits: byte=64): string;
begin
SetLength(Result, p_nb_digits);
while p_nb_digits > 0 do
begin
if odd(p_nb_int) then
Result[p_nb_digits] := '1'
else
Result[p_nb_digits] := '0';
p_nb_int := p_nb_int shr 1;
dec(p_nb_digits);
end;
end;