public static long GetInt64(this IRng rng, long minInclusive, long maxInclusive) { var range = Math.Abs(maxInclusive - minInclusive); var i = rng.GetInt64(range); return(i + minInclusive); }
public static long GetInt64(this IRng rng, long maxInclusive) { var i = rng.GetInt64(); var r = i % (maxInclusive + 1); if (r < 0) { r *= -1; } return(r); }