- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
Ent := 0.0;
for I := Low(Freq) to High(Freq) do
Ent := Ent + Freq[I];
Ent := Ln(FileSize(Input)) / Ln(2) * Ent;
for I := Low(Freq) to High(Freq) do
begin
if Freq[I] > 0 then
Ent := Ent - Freq[I] * Ln(Freq[I]) / Ln(2);
end;
Ent := Ent / FileSize(Input);