- Timestamp:
- 11/26/09 15:55:11 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataAnalysis/3.2/Statistics.cs
r2136 r2535 163 163 if (values.Length == 0) throw new InvalidOperationException(); 164 164 int n = values.Length; 165 if (n == 0)166 return 0;167 168 165 double[] sortedValues = new double[n]; 169 166 … … 175 172 return sortedValues[n / 2]; 176 173 } else { 177 return (sortedValues[ n / 2] + sortedValues[n / 2 + 1]) / 2.0;174 return (sortedValues[(n / 2)-1] + sortedValues[n / 2 ]) / 2.0; 178 175 } 179 176 }
Note: See TracChangeset
for help on using the changeset viewer.