You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Otherwise a zero will be returned when NextULongInner() returns zero, which is approximately every 2^64 calls (approx. 1.8*10^19) if the underlying PRNG is capable of generating zero, which all of the redzen PRNGs are. This makes the error an exceedingly rare event, but it is possible and thus a definite bug. E.g. if this method were called a billion times a second, then we can expect to see a zero approximately once every 31 years!
The text was updated successfully, but these errors were encountered:
- Doubled sampling resolution of NextDoubleNonZero().
- Added IRandomSource.NextFloatNonZero().
- Reordered methods in IRandomSource to a slightly more logical order
- Removed [MethodImpl(MethodImplOptions.AggressiveInlining)] in a few places, as the JIT compiler will inline where appropriate without this hint.
- Added RandomSourceBaseTests; this performs bounds checks on most of the IRandomSource methods.
This:
return ((NextULongInner() >> 11) & 0x1f_ffff_ffff_fffe) * INCR_DOUBLE;
Should be:
return (((NextULongInner() >> 11) & 0x1f_ffff_ffff_fffe)+1) * INCR_DOUBLE;
Otherwise a zero will be returned when NextULongInner() returns zero, which is approximately every 2^64 calls (approx. 1.8*10^19) if the underlying PRNG is capable of generating zero, which all of the redzen PRNGs are. This makes the error an exceedingly rare event, but it is possible and thus a definite bug. E.g. if this method were called a billion times a second, then we can expect to see a zero approximately once every 31 years!
The text was updated successfully, but these errors were encountered: