pub fn bernoulli<const N: usize>() -> [f64; N]Expand description
Bernoulli numbers $B_0, \ldots, B_{N-1}$
Corresponds to scipy.special.bernoulli in SciPy, and uses a translation of
xsf::specfun::bernob.
§Examples
use xsf::bernoulli;
assert_eq!(bernoulli::<0>(), []);
assert_eq!(bernoulli::<1>(), [1.0]);
assert_eq!(bernoulli::<2>(), [1.0, -0.5]);
assert_eq!(bernoulli::<4>(), [1.0, -0.5, 1.0 / 6.0, 0.0]);
assert_eq!(bernoulli::<1000>()[999], 0.0);§Panics
- If
Nis so large thatN - 1overflowsi32.
§See also
euler: Euler numbers $E_0,\dotsc,E_{N-1}$