Example #1
0
 public static int Sign(ref uint seed)
 {
     if (SeedRandom.Xorshift(ref seed) % 2 != 0)
     {
         return(-1);
     }
     return(1);
 }
Example #2
0
 public int Sign()
 {
     if (SeedRandom.Xorshift(ref this.Seed) % 2 != 0)
     {
         return(-1);
     }
     return(1);
 }
Example #3
0
    public static int Range(ref uint seed, int min, int max)
    {
        uint num = (uint)(max - min);

        return((int)(min + SeedRandom.Xorshift(ref seed) % num));
    }
Example #4
0
 public static float Xorshift01(ref uint x)
 {
     return((float)((float)SeedRandom.Xorshift(ref x)) * 2.32830644E-10f);
 }