diff options
author | Jb Evain <jbevain@gmail.com> | 2008-04-30 11:19:29 +0400 |
---|---|---|
committer | Jb Evain <jbevain@gmail.com> | 2008-04-30 11:19:29 +0400 |
commit | cd0dce7d037f7facd3235ed5681922e73c57b61a (patch) | |
tree | b63292227e5ce46c5f9ee1b9010c378eba7c401e /mcs/class/System.Core/System.Linq/Enumerable.cs | |
parent | 16b0de71fa9fb0641d90c7daefcb52c4f86cc535 (diff) |
2008-04-30 Jb Evain <jbevain@novell.com>
* Enumerable.cs: Average (int|long): properly compute
average.
svn path=/trunk/mcs/; revision=102177
Diffstat (limited to 'mcs/class/System.Core/System.Linq/Enumerable.cs')
-rw-r--r-- | mcs/class/System.Core/System.Linq/Enumerable.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mcs/class/System.Core/System.Linq/Enumerable.cs b/mcs/class/System.Core/System.Linq/Enumerable.cs index 9d55a55ff3d..1c47e3facde 100644 --- a/mcs/class/System.Core/System.Linq/Enumerable.cs +++ b/mcs/class/System.Core/System.Linq/Enumerable.cs @@ -137,12 +137,12 @@ namespace System.Linq public static double Average (this IEnumerable<int> source) { - return Average (source, (a, b) => a + b, (a, b) => a / b); + return Average (source, (a, b) => a + b, (a, b) => (double) a / (double) b); } public static double Average (this IEnumerable<long> source) { - return Average (source, (a, b) => a + b, (a, b) => a / b); + return Average (source, (a, b) => a + b, (a, b) => (double) a / (double) b); } public static double Average (this IEnumerable<double> source) |