mirror of
https://github.com/golang/go
synced 2024-11-26 06:57:56 -07:00
- binomial implementation (fixing broken build)
R=r OCL=18738 CL=18738
This commit is contained in:
parent
175dd773e6
commit
483e031525
@ -841,6 +841,11 @@ export func Fact(n uint) *Natural {
|
||||
}
|
||||
|
||||
|
||||
export func Binomial(n, k uint) *Natural {
|
||||
return MulRange(n-k+1, n).Div(MulRange(1, k));
|
||||
}
|
||||
|
||||
|
||||
func (x *Natural) Gcd(y *Natural) *Natural {
|
||||
// Euclidean algorithm.
|
||||
for !y.IsZero() {
|
||||
|
Loading…
Reference in New Issue
Block a user