-
Notifications
You must be signed in to change notification settings - Fork 11
/
exponentiate.h
32 lines (23 loc) · 1015 Bytes
/
exponentiate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*----------------------------------------------------------------------
| Copyright 2020-2021 Mersenne Research, Inc. All rights reserved
|
| Auxiliary routines to exponentiate gwnums
+---------------------------------------------------------------------*/
#ifndef _EXPONENTIATE_H
#define _EXPONENTIATE_H
/* This is used by C and C++ code. If used in a C++ program, don't let the C++ compiler mangle names. */
#ifdef __cplusplus
extern "C" {
#endif
// Raise a gwnum to a power
void simple_exponentiate (gwhandle *gwdata, gwnum x, uint64_t power);
// Raise a gwnum to a power
void exponentiate (gwhandle *gwdata, gwnum x, uint64_t power);
// Raise a gwnum to a mpz power (assume 1GB memory available for temps
void exponentiate_mpz (gwhandle *gwdata, gwnum x, mpz_t power);
// Raise a gwnum to a mpz power using a maximum number of temporaries
void exponentiate_mpz_limited_temps (gwhandle *gwdata, gwnum x, mpz_t power, int num_temps);
#ifdef __cplusplus
}
#endif
#endif