akydd / combination

go cached combinations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

combination

Calculate nCk using Int from math/big.

Uses a map[int]map[int]*big.Int for some caching but this is only useful for repeated calls. I have no idea if this speeds up performance!

Example

// initialize
c := NewCombination()

// calculate 90C18
v := c.Choose(90, 18)

About

go cached combinations


Languages

Language:Go 100.0%