Skybuck's Universal Code 4,Delphi Demonstration Program
Little improvement:
The math unit is not needed.
// replace uses with:
uses
SysUtils, Classes;
Neither is the following function:
delete these lines:
// limited to 64 bit values, returns 1 for value zero.
function bits_needed_for_decimal_value( value : extended ) : integer;
begin
// result := round( ceil( log10(1+value) / log10(2) ) );
// same as this I hope:
result := round( ceil( log2(1+value) ) );
if result = 0 then result := 1;
end;
Rest stays the same.
Bye,
Skybuck.
|