Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Can your programming language do this?. Parent comment
double entropy = -1.0d * mydata.Select(x => x * Math.Log10(x)).Sum();
Where 'mydata' is of type IEnumerable<double>.
double entropy = -1.0d * mydata.Select(x => x * Math.Log10(x)).Sum();
Where 'mydata' is of type IEnumerable<double>.