MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / RandHelper

Function RandHelper

Source/Engine/Core/RandomStream.h:159–162  ·  view source on GitHub ↗

Helper function for rand implementations. Top border A random number in [0..A)

Source from the content-addressed store, hash-verified

157 /// <param name="a">Top border</param>
158 /// <returns>A random number in [0..A)</returns>
159 FORCE_INLINE int32 RandHelper(int32 a) const
160 {
161 return a > 0 ? Math::TruncToInt(GetFraction() * ((float)a - ZeroTolerance)) : 0;
162 }
163
164 /// <summary>
165 /// Helper function for rand implementations

Callers 2

RandomStream.csFile · 0.85
RandRangeFunction · 0.85

Calls 2

GetFractionFunction · 0.85
TruncToIntFunction · 0.50

Tested by

no test coverage detected