Entropy: Difference between revisions

Content deleted Content added
Davgot (talk | contribs)
Davgot (talk | contribs)
Line 2,970: Line 2,970:


fn H(s: []const u8) f64 {
fn H(s: []const u8) f64 {
var counts = [_]u8{0} ** 256;
var counts = [_]u16{0} ** 256;
for (s) |ch|
for (s) |ch|
counts[ch] += 1;
counts[ch] += 1;
Line 2,988: Line 2,988:
1.846439344671
1.846439344671
</pre>
</pre>

=={{header|zkl}}==
=={{header|zkl}}==
{{trans|D}}
{{trans|D}}