SL-20546: Avoid promoting F32 to double just to compare bounds.
parent
1c71a8e78e
commit
e7ae20c96f
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue