FastRng/FastRng/Double/Distributions/Uniform.cs

12 lines
370 B
C#
Raw Normal View History

2020-09-25 22:06:14 +00:00
using System.Threading;
using System.Threading.Tasks;
2020-09-26 09:40:01 +00:00
namespace FastRng.Double.Distributions
2020-09-25 22:06:14 +00:00
{
public sealed class Uniform : IDistribution
{
public IRandom Random { get; set; }
2020-09-26 09:46:54 +00:00
public async ValueTask<double> GetDistributedValue(CancellationToken token = default) => this.Random == null ? 0 : await this.Random.GetUniform(token);
2020-09-25 22:06:14 +00:00
}
}