View Single Post
  #2  
Old May 28th 07, 11:00 PM posted to alt.comp.lang.borland-delphi,alt.comp.periphs.mainboard.asus,alt.comp.periphs.videocards.nvidia,comp.arch,sci.electronics.design
Skybuck Flying
external usenet poster
 
Posts: 917
Default 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.