* Enumerable.cs: Add missing cast Average on IEnumerable<long?> to ensure the result is not truncated. [Found using Gendarme's ReviewCastOnIntegerDivisionRule] svn path=/trunk/mcs/; revision=114330
@@ -1,3 +1,9 @@
+2008-09-28 Sebastien Pouliot <[email protected]>
+
+ * Enumerable.cs: Add missing cast Average on IEnumerable<long?> to
+ ensure the result is not truncated.
+ [Found using Gendarme's ReviewCastOnIntegerDivisionRule]
2008-09-11 Jb Evain <[email protected]>
* Enumerable.cs (Iterate*): use a bool empty instead of an int counter.
@@ -225,7 +225,7 @@ namespace System.Linq
{
Check.Source (source);
- return source.AverageNullable<long, long, double> ((a, b) => a + b, (a, b) => a / b);
+ return source.AverageNullable<long, long, double> ((a, b) => a + b, (a, b) => (double) a / b);
}
public static double? Average (this IEnumerable<double?> source)