diff --git a/FastRng/Double/Distributions/Exponential.cs b/FastRng/Double/Distributions/Exponential.cs index ec5102e..9a017b1 100644 --- a/FastRng/Double/Distributions/Exponential.cs +++ b/FastRng/Double/Distributions/Exponential.cs @@ -6,7 +6,7 @@ namespace FastRng.Double.Distributions { public sealed class Exponential : IDistribution { - private double mean = 1; + private double mean = 1.0; public IRandom Random { get; set; } @@ -15,7 +15,7 @@ namespace FastRng.Double.Distributions get => this.mean; set { - if(value <= 0) + if(value <= 0.0) throw new ArgumentOutOfRangeException(message: "Mean must be greater than 0", null); this.mean = value; @@ -27,7 +27,7 @@ namespace FastRng.Double.Distributions if (this.Random == null) return 0.0; - if(this.Mean == 1) + if(this.Mean == 1.0) return -Math.Log(await this.Random.GetUniform(token)); else return this.Mean * -Math.Log(await this.Random.GetUniform(token)); diff --git a/FastRng/Double/Distributions/Gamma.cs b/FastRng/Double/Distributions/Gamma.cs index 73885f7..266c381 100644 --- a/FastRng/Double/Distributions/Gamma.cs +++ b/FastRng/Double/Distributions/Gamma.cs @@ -6,7 +6,7 @@ namespace FastRng.Double.Distributions { public sealed class Gamma : IDistribution { - private double shape = 1; + private double shape = 1.0; public IRandom Random { get; set; } @@ -15,14 +15,14 @@ namespace FastRng.Double.Distributions get => this.shape; set { - if(value <= 0) + if(value <= 0.0) throw new ArgumentOutOfRangeException(message: "Shape must be greater than 0", null); this.shape = value; } } - public double Scale { get; set; } = 1; + public double Scale { get; set; } = 1.0; public async ValueTask GetDistributedValue(CancellationToken token) { diff --git a/FastRng/Double/Distributions/Normal.cs b/FastRng/Double/Distributions/Normal.cs index 99521ab..403b45a 100644 --- a/FastRng/Double/Distributions/Normal.cs +++ b/FastRng/Double/Distributions/Normal.cs @@ -6,18 +6,18 @@ namespace FastRng.Double.Distributions { public sealed class Normal : IDistribution { - private double standardDeviation = 1; + private double standardDeviation = 1.0; public IRandom Random { get; set; } - public double Mean { get; set; } = 0; + public double Mean { get; set; } = 0.0; public double StandardDeviation { get => this.standardDeviation; set { - if(value <= 0) + if(value <= 0.0) throw new ArgumentOutOfRangeException(message: "Standard deviation must be greater than 0", null); this.standardDeviation = value;