diff --git a/FastRng/Double/Distributions/ChiSquare.cs b/FastRng/Double/Distributions/ChiSquare.cs index 2d5a62d..3bc46bb 100644 --- a/FastRng/Double/Distributions/ChiSquare.cs +++ b/FastRng/Double/Distributions/ChiSquare.cs @@ -25,7 +25,7 @@ namespace FastRng.Double.Distributions public async ValueTask GetDistributedValue(CancellationToken token = default) { if (this.Random == null) - return System.Double.NaN; + return double.NaN; return await this.Random.NextNumber(new Gamma{ Shape = 0.5 * this.DegreesOfFreedom, Scale = 2.0 }, token); } diff --git a/FastRng/Double/Distributions/Exponential.cs b/FastRng/Double/Distributions/Exponential.cs index 27467e9..f75f0cf 100644 --- a/FastRng/Double/Distributions/Exponential.cs +++ b/FastRng/Double/Distributions/Exponential.cs @@ -25,7 +25,7 @@ namespace FastRng.Double.Distributions public async ValueTask GetDistributedValue(CancellationToken token = default) { if (this.Random == null) - return System.Double.NaN; + return double.NaN; if(this.Mean == 1.0) return -Math.Log(await this.Random.GetUniform(token)); diff --git a/FastRng/Double/Distributions/Gamma.cs b/FastRng/Double/Distributions/Gamma.cs index ffd0c0f..60be1d5 100644 --- a/FastRng/Double/Distributions/Gamma.cs +++ b/FastRng/Double/Distributions/Gamma.cs @@ -29,7 +29,7 @@ namespace FastRng.Double.Distributions public async ValueTask GetDistributedValue(CancellationToken token = default) { if (this.Random == null) - return System.Double.NaN; + return double.NaN; // Implementation based on "A Simple Method for Generating Gamma Variables" // by George Marsaglia and Wai Wan Tsang. ACM Transactions on Mathematical Software diff --git a/FastRng/Double/Distributions/InverseGamma.cs b/FastRng/Double/Distributions/InverseGamma.cs index 70cd441..305dc08 100644 --- a/FastRng/Double/Distributions/InverseGamma.cs +++ b/FastRng/Double/Distributions/InverseGamma.cs @@ -27,7 +27,7 @@ namespace FastRng.Double.Distributions public async ValueTask GetDistributedValue(CancellationToken token = default) { if (this.Random == null) - return System.Double.NaN; + return double.NaN; var gammaDist = new Gamma{ Shape = this.Shape, Scale = 1.0 / this.Scale }; return 1.0 / await this.Random.NextNumber(gammaDist, token); diff --git a/FastRng/Double/Distributions/Laplace.cs b/FastRng/Double/Distributions/Laplace.cs index 3921101..26eb270 100644 --- a/FastRng/Double/Distributions/Laplace.cs +++ b/FastRng/Double/Distributions/Laplace.cs @@ -15,7 +15,7 @@ namespace FastRng.Double.Distributions public async ValueTask GetDistributedValue(CancellationToken token = default) { if (this.Random == null) - return System.Double.NaN; + return double.NaN; var value = await this.Random.GetUniform(token); diff --git a/FastRng/Double/Distributions/LogNormal.cs b/FastRng/Double/Distributions/LogNormal.cs index 3612552..65b3302 100644 --- a/FastRng/Double/Distributions/LogNormal.cs +++ b/FastRng/Double/Distributions/LogNormal.cs @@ -26,7 +26,7 @@ namespace FastRng.Double.Distributions public async ValueTask GetDistributedValue(CancellationToken token = default) { if (this.Random == null) - return System.Double.NaN; + return double.NaN; var normal = await this.Random.NextNumber(new Normal {Mean = this.Mu, StandardDeviation = this.Sigma}, token); return Math.Exp(normal); diff --git a/FastRng/Double/Distributions/Normal.cs b/FastRng/Double/Distributions/Normal.cs index 3d05b7a..b7b4035 100644 --- a/FastRng/Double/Distributions/Normal.cs +++ b/FastRng/Double/Distributions/Normal.cs @@ -27,7 +27,7 @@ namespace FastRng.Double.Distributions public async ValueTask GetDistributedValue(CancellationToken token = default) { if (this.Random == null) - return System.Double.NaN; + return double.NaN; var u1 = await this.Random.GetUniform(token); var u2 = await this.Random.GetUniform(token); diff --git a/FastRng/Double/Distributions/StudentT.cs b/FastRng/Double/Distributions/StudentT.cs index 1ee1ac9..b605204 100644 --- a/FastRng/Double/Distributions/StudentT.cs +++ b/FastRng/Double/Distributions/StudentT.cs @@ -26,7 +26,7 @@ namespace FastRng.Double.Distributions public async ValueTask GetDistributedValue(CancellationToken token = default) { if (this.Random == null) - return System.Double.NaN; + return double.NaN; var normal = await this.Random.NextNumber(NORMAL_DISTRIBUTED, token); var chiSquare = await this.Random.NextNumber(new ChiSquare {DegreesOfFreedom = this.DegreesOfFreedom}, token); diff --git a/FastRng/Double/Distributions/Uniform.cs b/FastRng/Double/Distributions/Uniform.cs index 784464d..49e92f7 100644 --- a/FastRng/Double/Distributions/Uniform.cs +++ b/FastRng/Double/Distributions/Uniform.cs @@ -7,6 +7,6 @@ namespace FastRng.Double.Distributions { public IRandom Random { get; set; } - public async ValueTask GetDistributedValue(CancellationToken token = default) => this.Random == null ? System.Double.NaN : await this.Random.GetUniform(token); + public async ValueTask GetDistributedValue(CancellationToken token = default) => this.Random == null ? double.NaN : await this.Random.GetUniform(token); } } \ No newline at end of file diff --git a/FastRng/Double/Distributions/Weibull.cs b/FastRng/Double/Distributions/Weibull.cs index fdc0c32..636798e 100644 --- a/FastRng/Double/Distributions/Weibull.cs +++ b/FastRng/Double/Distributions/Weibull.cs @@ -38,7 +38,7 @@ namespace FastRng.Double.Distributions public async ValueTask GetDistributedValue(CancellationToken token = default) { if (this.Random == null) - return System.Double.NaN; + return double.NaN; var value = await this.Random.GetUniform(token); return this.Scale * Math.Pow(-Math.Log(value), 1.0 / this.Shape);