News for hackers. Stuff that matters.
Re:Can your programming language do this? by tedunangst on Wednesday July 08, 2009 @05:00PM (#694682)
"Having a language that lets you declare constructs that look very similar to their mathematical definition is a huge win for readability."

I'd agree, except every mathematical definition I've seen used infix notation. Minus a function for summing a series, the C version at least keeps the symbols in the same order. Anyone with even a passing familiarity of C can read this and recognize it as the same thing.

  double entropy(int x) {
    double e = 0.0;
    for (int i = 0; i < x; i++) e += p(i) * log(p(i));
    return -e;
  }

There are no comments on this comment yet.