SL-20546: Avoid promoting F32 to double just to compare bounds.

meow-7.2.2
Nat Goodspeed 2023-11-17 10:24:14 -05:00
parent 1c71a8e78e
commit e7ae20c96f
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ inline F32 ll_internal_random<F32>()
// than expanding to F64 for fmod() and then truncating back to F32. Prior
// to this change, we were getting sporadic ll_frand() == 1.0 results.
F32 rv{ narrow(ll_internal_random_unclamped()) };
if(!((rv >= 0.0) && (rv < 1.0))) return fmodf(rv, 1.0f);
if(!((rv >= 0.0f) && (rv < 1.0f))) return fmodf(rv, 1.0f);
return rv;
}