Entropy: Difference between revisions
Content deleted Content added
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)
|