Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Testing latest pari + WASM + node.js... and it works?! Wow.

28493 views
License: GPL3
ubuntu2004
Function: bernfrac
Section: combinatorics
C-Name: bernfrac
Prototype: L
Help: bernfrac(n): Bernoulli number B_n, as a rational number.
Doc: Bernoulli number\sidx{Bernoulli numbers} $B_n$,
 where $B_0=1$, $B_1=-1/2$, $B_2=1/6$,\dots, expressed as a rational number.
 The argument $n$ should be a nonnegative integer. The function \tet{bervec}
 creates a cache of successive Bernoulli numbers which greatly speeds up
 later calls to \kbd{bernfrac}:
 \bprog
 ? bernfrac(20000);
 time = 107 ms.
 ? bernvec(10000); \\ cache B_0, B_2, ..., B_20000
 time = 35,957 ms.
 ? bernfrac(20000); \\ now instantaneous
 ?
 @eprog