Entropy: Difference between revisions
Content deleted Content added
Line 2,970: | Line 2,970: | ||
fn H(s: []const u8) f64 { |
fn H(s: []const u8) f64 { |
||
var counts = [_] |
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}} |