num::integer

Function binomial

Source
pub fn binomial<T>(n: T, k: T) -> T
where T: Integer + Clone,
Expand description

Calculate the binomial coefficient.

Note that this might overflow, depending on T. For the primitive integer types, the following n are the largest ones possible such that there will be no overflow for any k:

typen
u810
i89
u1618
i1617
u3234
i3233
u6467
i6466

For larger n, consider using a bigint type for T.