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

◆ Next() [2/3]

override int System.Random.XoshiroImpl.Next ( int maxValue)
inline

Definition at line 493 of file Random.cs.

494 {
495 if (maxValue > 1)
496 {
497 int num = BitOperations.Log2Ceiling((uint)maxValue);
498 ulong num2;
499 do
500 {
501 num2 = NextUInt64() >> 64 - num;
502 }
503 while (num2 >= (uint)maxValue);
504 return (int)num2;
505 }
506 return 0;
507 }
static int Log2Ceiling(uint value)

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