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

Function GetFraction

Source/Engine/Core/RandomStream.h:112–119  ·  view source on GitHub ↗

Returns a random number between 0 and 1.

Source from the content-addressed store, hash-verified

110 /// Returns a random number between 0 and 1.
111 /// </summary>
112 float GetFraction() const
113 {
114 MutateSeed();
115 const float temp = 1.0f;
116 float result;
117 *(int32*)&result = (*(int32*)&temp & 0xff800000) | (_seed & 0x007fffff);
118 return Math::Fractional(result);
119 }
120
121 /// <summary>
122 /// Returns a random number between 0 and 1.

Callers 5

RandomStream.csFile · 0.85
RandFunction · 0.85
GetUnitVectorFunction · 0.85
GetVector3Function · 0.85
RandHelperFunction · 0.85

Calls 1

FractionalFunction · 0.50

Tested by

no test coverage detected