MCPcopy Create free account
hub / github.com/assaultcube/AC / RandomFloat

Function RandomFloat

source/src/bot/bot_util.cpp:90–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90float RandomFloat (float from, float to)
91{
92 // this function returns a random floating-point number between (and including)
93 // the starting and ending values passed by parameters from and to.
94
95 if (to <= from)
96 return (from);
97
98 return (from + (float) lrand () / ((float) LRAND_MAX / (to - from)));
99}
100
101// End random functions
102

Callers 7

AimToIdealMethod · 0.85
GetEnemyPosMethod · 0.85
FindEnemyMethod · 0.85
CheckHuntMethod · 0.85
HuntEnemyMethod · 0.85
GetShootDelayMethod · 0.85
CheckFOVMethod · 0.85

Calls 1

lrandFunction · 0.85

Tested by

no test coverage detected