O'Reilly logo
  • Sen Sun thinks this is interesting:

ent=ent-p*log2(p)

From

Cover of Programming Collective Intelligence

Note

ent += p*log2(p)