Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Average() [2/10]

static ? decimal System.Linq.Enumerable.Average ( this IEnumerable< decimal?> source)
inlinestatic

Definition at line 3950 of file Enumerable.cs.

3951 {
3952 if (source == null)
3953 {
3954 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
3955 }
3957 {
3958 while (enumerator.MoveNext())
3959 {
3960 decimal? current = enumerator.Current;
3961 if (!current.HasValue)
3962 {
3963 continue;
3964 }
3965 decimal valueOrDefault = current.GetValueOrDefault();
3966 long num = 1L;
3967 while (enumerator.MoveNext())
3968 {
3969 current = enumerator.Current;
3970 if (current.HasValue)
3971 {
3972 valueOrDefault += current.GetValueOrDefault();
3973 num++;
3974 }
3975 }
3976 return valueOrDefault / (decimal)num;
3977 }
3978 }
3979 return null;
3980 }

References System.Collections.Generic.Dictionary< TKey, TValue >.GetEnumerator(), System.L, System.Linq.source, and System.Linq.ThrowHelper.ThrowArgumentNullException().