FNFT
Loading...
Searching...
No Matches
fnft_numtypes.h
Go to the documentation of this file.
1/*
2* This file is part of FNFT.
3*
4* FNFT is free software; you can redistribute it and/or
5* modify it under the terms of the version 2 of the GNU General
6* Public License as published by the Free Software Foundation.
7*
8* FNFT is distributed in the hope that it will be useful,
9* but WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15*
16* Contributors:
17* Sander Wahls (TU Delft) 2017-2018.
18*/
19
27#ifndef FNFT_NUMTYPES_H
28#define FNFT_NUMTYPES_H
29
30#include <math.h>
31#include <float.h>
32#include <complex.h>
33#include <stdint.h>
34#include <stdlib.h>
35
40typedef double FNFT_REAL;
41
46#ifndef __cplusplus
47typedef double complex FNFT_COMPLEX;
48#else
49typedef std::complex<double> FNFT_COMPLEX;
50#endif
51
56typedef int32_t FNFT_INT;
57
62typedef size_t FNFT_UINT;
63
68#define FNFT_EPSILON DBL_EPSILON
69
74#define FNFT_NAN NAN
75
80#define FNFT_INF INFINITY
81
86#define FNFT_FABS(X) fabs(X)
87
92#define FNFT_SQRT(X) sqrt(X)
93
98#define FNFT_COS(X) cos(X)
99
104#define FNFT_SIN(X) sin(X)
105
110#define FNFT_SINH(X) sinh(X)
111
116#define FNFT_COSH(X) cosh(X)
117
122#define FNFT_TANH(X) tanh(X)
123
128#define FNFT_ATAN(X) atan(X)
129
134#define FNFT_LOG(X) log(X)
135
140#define FNFT_LOG2(X) log2(X)
141
146#define FNFT_POW(X, Y) pow(X, Y)
147
152#define FNFT_GAMMA(X) tgamma(X)
153
159#define FNFT_PI acos(-1.0)
160
166#define FNFT_FLOOR(X) floor(X)
167
173#define FNFT_ROUND(X) round(X)
174
180#define FNFT_CEIL(X) ceil(X)
181
186#define FNFT_HYPOT(X,Y) hypot(X,Y)
187
192#define FNFT_CREAL(X) creal(X)
193
198#define FNFT_CIMAG(X) cimag(X)
199
204#define FNFT_CABS(X) cabs(X)
205
210#define FNFT_CARG(X) carg(X)
211
216#define FNFT_CONJ(X) conj(X)
217
222#define FNFT_CPOW(X,Y) cpow(X,Y)
223
228#define FNFT_CEXP(X) cexp(X)
229
234#define FNFT_CLOG(X) clog(X)
235
240#define FNFT_CSQRT(X) csqrt(X)
241
246#define FNFT_CSINH(X) csinh(X)
247
252#define FNFT_CCOSH(X) ccosh(X)
253
258#define FNFT_CSIN(X) csin(X)
259
264#define FNFT_CCOS(X) ccos(X)
265
270#define FNFT_ATANH(X) atanh(X)
271
272#ifdef FNFT_ENABLE_SHORT_NAMES
273#define REAL FNFT_REAL
274#define COMPLEX FNFT_COMPLEX
275#define INT FNFT_INT
276#define UINT FNFT_UINT
277#define CABS(X) FNFT_CABS(X)
278#define FABS(X) FNFT_FABS(X)
279#define FLOOR(X) FNFT_FLOOR(X)
280#define CEIL(X) FNFT_CEIL(X)
281#define ROUND(X) FNFT_ROUND(X)
282#define POW(X,Y) FNFT_POW(X,Y)
283#define CPOW(X,Y) FNFT_CPOW(X,Y)
284#define LOG2(X) FNFT_LOG2(X)
285#define LOG(X) FNFT_LOG(X)
286#define CLOG(X) FNFT_CLOG(X)
287#define COS(X) FNFT_COS(X)
288#define SIN(X) FNFT_SIN(X)
289#define ATAN(X) FNFT_ATAN(X)
290#define SQRT(X) FNFT_SQRT(X)
291#define EPSILON FNFT_EPSILON
292#define CSINH(X) FNFT_CSINH(X)
293#define CCOSH(X) FNFT_CCOSH(X)
294#define CCOS(X) FNFT_CCOS(X)
295#define CSIN(X) FNFT_CSIN(X)
296#define COSH(X) FNFT_COSH(X)
297#define SINH(X) FNFT_SINH(X)
298#define TANH(X) FNFT_TANH(X)
299#define HYPOT(X,Y) FNFT_HYPOT(X,Y)
300#define CREAL(X) FNFT_CREAL(X)
301#define CIMAG(X) FNFT_CIMAG(X)
302#define CONJ(X) FNFT_CONJ(X)
303#define CSQRT(X) FNFT_CSQRT(X)
304#define CEXP(X) FNFT_CEXP(X)
305#define CARG(X) FNFT_CARG(X)
306#define PI FNFT_PI
307#define GAMMA(X) FNFT_GAMMA(X)
308#define ATANH(X) FNFT_ATANH(X)
309#endif
310
311#endif
size_t FNFT_UINT
Definition fnft_numtypes.h:62
double complex FNFT_COMPLEX
Definition fnft_numtypes.h:47
int32_t FNFT_INT
Definition fnft_numtypes.h:56
double FNFT_REAL
Definition fnft_numtypes.h:40