Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ NextInt64() [2/3]

override long System.Random.XoshiroImpl.NextInt64 ( long maxValue)
inline

Definition at line 537 of file Random.cs.

538 {
539 if (maxValue > 1)
540 {
541 int num = BitOperations.Log2Ceiling((ulong)maxValue);
542 ulong num2;
543 do
544 {
545 num2 = NextUInt64() >> 64 - num;
546 }
547 while (num2 >= (ulong)maxValue);
548 return (long)num2;
549 }
550 return 0L;
551 }
static int Log2Ceiling(uint value)

References System.L, System.Numerics.BitOperations.Log2Ceiling(), and System.Random.XoshiroImpl.NextUInt64().