aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2024-11-28 11:27:25 +0000
committerGitHub <noreply@github.com>2024-11-28 11:27:25 +0000
commitbb96e54308838877d69a7d33314fd1ea3636ea7f (patch)
tree99de575bdb1f2f07c90d985113178301c22a7843
parent44124cb639a198092204a0167ef827ea41ad023e (diff)
parent36481f6d4aebf7d5e34ada6cfca996cfb8c31fe4 (diff)
Merge pull request #4531 from Nave55/master
Fix math binomial proc giving wrong result
-rw-r--r--core/math/math.odin2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/math/math.odin b/core/math/math.odin
index 0e21afa67..934842318 100644
--- a/core/math/math.odin
+++ b/core/math/math.odin
@@ -1271,7 +1271,7 @@ binomial :: proc "contextless" (n, k: int) -> int {
}
b := n
- for i in 2..<k {
+ for i in 2..=k {
b = (b * (n+1-i))/i
}
return b