This commit is contained in:
Andrei Alexandrescu 2009-04-19 17:20:58 +00:00
parent cb817dd1c8
commit 04a3e40b2e

View file

@ -272,7 +272,7 @@ public:
} }
ReturnType!(ElementType!(Range)) ReturnType!(ElementType!(Range))
reduce(Range)(Range r) reduce(Range)(Range r) if (isInputRange!Range)
{ {
static if (fun.length == 1) static if (fun.length == 1)
auto e = r.front; auto e = r.front;
@ -3461,7 +3461,7 @@ unittest
foreach (p; probs) { foreach (p; probs) {
if (!p) continue; if (!p) continue;
//enforce(p > 0 && p <= 1, "Wrong probability passed to entropy"); //enforce(p > 0 && p <= 1, "Wrong probability passed to entropy");
result -= p * log(p); result -= p * log2(p);
} }
return result; return result;
} }