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

◆ Average() [6/10]

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

Definition at line 3844 of file Enumerable.cs.

3845 {
3846 if (source == null)
3847 {
3848 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.source);
3849 }
3851 {
3852 while (enumerator.MoveNext())
3853 {
3854 float? current = enumerator.Current;
3855 if (!current.HasValue)
3856 {
3857 continue;
3858 }
3859 double num = current.GetValueOrDefault();
3860 long num2 = 1L;
3861 while (enumerator.MoveNext())
3862 {
3863 current = enumerator.Current;
3864 if (current.HasValue)
3865 {
3866 num += (double)current.GetValueOrDefault();
3867 num2 = checked(num2 + 1);
3868 }
3869 }
3870 return (float)(num / (double)num2);
3871 }
3872 }
3873 return null;
3874 }

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