Anonymous user
Entropy: Difference between revisions
Update to make the program compile with Nim 1.4: added missing type to parameter.
m (→version 2: added/changed whitespace.) |
(Update to make the program compile with Nim 1.4: added missing type to parameter.) |
||
Line 1,661:
<lang nim>import tables, math
proc entropy(s: string): float =
var t = initCountTable[char]()
for c in s: t.inc(c)
|