函数 bernoulli #

返回第 n 个伯努利数,适用于正整数 n

Syntax #

math.bernoulli(n)

Parameters #

Parameter Type Description
n 数字 | BigNumber | bigint | 分数 伯努利数的索引

Returns #

Type Description
数字 | BigNumber | 分数 n 个伯努利数,类型与参数 n 对应

Throws #

Type | Description —- | ———–

Examples #

math.bernoulli(1)                  // returns -0.5
// All other odd Bernoulli numbers are 0:
math.bernoulli(7)                  // returns 0
math.bernoulli(math.bignumber(6))  // value bignumber(1).div(42)
// Produces exact rationals for bigint or fraction input:
math.bernoulli(8n)                 // Fraction -1,30
math.bernoulli(math.fraction(10))  // Fraction 5,66

另请参阅 #

combinations, gamma, stirlingS2

Fork me on GitHub