public static IEnumerable <ulong> ToUlongEnumerator(this IRando rando, ulong maxVal) { var mask = Numbers.UlongMask(maxVal.HiBit()); while (true) { var retVal = rando.NextUlong() & mask; if (retVal < maxVal) { yield return(retVal); } } }
public static ulong NextUlong(this IRando rando, ulong maxVal) { var mask = Numbers.UlongMask(maxVal.HiBit()); while (true) { var retVal = rando.NextUlong() & mask; if (retVal < maxVal) { return(retVal); } } }
public IGene Mutate(IRando rando) { return(GeneUlongModN.Make(rando.NextUlong(MaxVal), MaxVal)); }
public override IGeneUlongModN NewBlock(IRando rando) { return(GeneUlongModN.Make(rando.NextUlong(MaxVal), MaxVal)); }