diff options
author | Sebastien Pouliot <sebastien@ximian.com> | 2008-09-28 18:55:32 +0400 |
---|---|---|
committer | Sebastien Pouliot <sebastien@ximian.com> | 2008-09-28 18:55:32 +0400 |
commit | 6fb0b958fa342a89bb2a05a1dc101ca955205ea8 (patch) | |
tree | 2494c327ae5133c0fa3f0d1f88841a1b332c39bc /mcs/class/System.Core/System.Linq/Enumerable.cs | |
parent | 77232da4fa136426c8c5d4342e7c94a081b16f6f (diff) |
2008-09-28 Sebastien Pouliot <sebastien@ximian.com>
* 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
Diffstat (limited to 'mcs/class/System.Core/System.Linq/Enumerable.cs')
-rw-r--r-- | mcs/class/System.Core/System.Linq/Enumerable.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mcs/class/System.Core/System.Linq/Enumerable.cs b/mcs/class/System.Core/System.Linq/Enumerable.cs index 4d46b21bc0a..ac06748b64a 100644 --- a/mcs/class/System.Core/System.Linq/Enumerable.cs +++ b/mcs/class/System.Core/System.Linq/Enumerable.cs @@ -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) |