Files
sjy01-image-proc/vendor/github.com/nuknal/goNum/Cnm.go
2024-10-24 15:46:01 +08:00

39 lines
822 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Cnm
/*
------------------------------------------------------
作者 : Black Ghost
日期 : 2018-12-6
版本 : 0.0.0
------------------------------------------------------
m
计算组合 C 的值
n
------------------------------------------------------
输入 :
n 整数
m 整数m <= n
输出 :
------------------------------------------------------
*/
package goNum
// Cnm
// m
// 计算组合 C 的值
// n
func Cnm(n, m int) int {
/*
m
计算组合 C 的值
n
输入 :
n 整数
m 整数m <= n
输出 :
*/
//不直接使用阶乘计算可以稍许增加速度
return Anm(n, m) / Factorial(m)
}