Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/rings/bernmm/bern_modp.h
4099 views
1
/*
2
bern_modp.cpp: computing isolated Bernoulli numbers modulo p
3
4
Copyright (C) 2008, 2009, David Harvey
5
6
This file is part of the bernmm package (version 1.1).
7
8
bernmm is released under a BSD-style license. See the README file in
9
the source distribution for details.
10
*/
11
12
#ifndef BERNMM_BERN_MODP_H
13
#define BERNMM_BERN_MODP_H
14
15
16
namespace bernmm {
17
18
19
/*
20
Returns B_k mod p, in [0, p), or -1 if B_k is not p-integral.
21
22
PRECONDITIONS:
23
2 <= p < NTL_SP_BOUND, p prime
24
k >= 0
25
*/
26
long bern_modp(long p, long k);
27
28
29
/*
30
Exported for testing.
31
*/
32
long _bern_modp_powg(long p, double pinv, long k);
33
long _bern_modp_pow2(long p, double pinv, long k);
34
35
36
};
37
38
39
#endif
40
41
// end of file ================================================================
42
43