Browse Source
Merge pull request #680 from manor/master
Ensure Hypergeometric.CDF <= 1.0 (Issue #679)
pull/697/head
Christoph Ruegg
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
src/Numerics/Distributions/Hypergeometric.cs
|
|
|
@ -315,7 +315,7 @@ namespace MathNet.Numerics.Distributions |
|
|
|
sum += Math.Exp(SpecialFunctions.BinomialLn(success, i) + SpecialFunctions.BinomialLn(population - success, draws - i) - denominatorLn); |
|
|
|
} |
|
|
|
|
|
|
|
return sum; |
|
|
|
return Math.Min(sum, 1.0); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|