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

◆ Average() [4/10]

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

Definition at line 3897 of file Enumerable.cs.

3898 {
3899 if (source == null)
3900 {
3901 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
3902 }
3904 {
3905 while (enumerator.MoveNext())
3906 {
3907 double? current = enumerator.Current;
3908 if (!current.HasValue)
3909 {
3910 continue;
3911 }
3912 double num = current.GetValueOrDefault();
3913 long num2 = 1L;
3914 while (enumerator.MoveNext())
3915 {
3916 current = enumerator.Current;
3917 if (current.HasValue)
3918 {
3919 num += current.GetValueOrDefault();
3920 num2 = checked(num2 + 1);
3921 }
3922 }
3923 return num / (double)num2;
3924 }
3925 }
3926 return null;
3927 }

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