MCPcopy Create free account
hub / github.com/PCGEx/PCGExtendedToolkit / GetAverage

Function GetAverage

Source/PCGExtendedToolkit/Public/PCGExMath.h:396–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394
395 template <typename T>
396 FORCEINLINE static T GetAverage(const TArray<T>& Values)
397 {
398 T Sum = 0;
399 for (const T Value : Values) { Sum += Value; }
400 return Div(Sum, Values.Num());
401 }
402
403 template <typename T>
404 FORCEINLINE static T GetMedian(const TArray<T>& Values)

Callers

nothing calls this directly

Calls 2

DivFunction · 0.85
NumMethod · 0.80

Tested by

no test coverage detected