1
0
mirror of https://github.com/golang/go synced 2024-11-26 09:18:07 -07:00

- binomial implementation (fixing broken build)

R=r
OCL=18738
CL=18738
This commit is contained in:
Robert Griesemer 2008-11-06 17:29:07 -08:00
parent 175dd773e6
commit 483e031525

View File

@ -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() {