arx/ArxLibertatis — comment on commit 64817c18fdfd305e80890a924cc0853ba3965f63
File:  line 0
By SebastienLussier:

Hello! I tracked a crash in the pathfinder to this change...

Before all our changes the initial line of code was:
#define rnd() (((FLOAT)rand() ) * 0.00003051850947599f)

0.00003051850947599f is really (1.f / RAND_MAX)...

With your change, if rand() returns RAND_MAX, we have
RAND_MAX * (1.0f / (RAND_MAX - 1))
that yields
1.0000305194408838

From my understanding, I could have also obtained this crash with / RAND_MAX... So maybe your change was to fix a crash in the pathfinder ?
Did you intended to write that instead ?
return rand() * (1.0f / (RAND_MAX + 1));

Seb