Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这个术语fac在 Haskell 中是什么意思?我在很多场合都见过它,但它似乎没有任何类型的定义。我知道它与阶乘有关,但不太确定人们提到这个词时的意思fac。
fac
这是一个例子:
sumFacs n = fac 0 + fac 1 + ... + fac (n-1) + fac n
通常fac指阶乘函数,可定义为:
fac :: Int -> Int fac 0 = 1 fac n = n * fac (n - 1)
当然,在 Haskell 中定义阶乘有很多不同的方法。
它是阶乘的缩写。