doubleFloat.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011 OpenFOAM Foundation
9  Copyright (C) 2018-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #ifndef Foam_doubleFloat_H
30 #define Foam_doubleFloat_H
31 
32 #include "label.H"
33 #include "products.H"
34 
35 #include <cmath>
36 
37 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 
39 namespace Foam
40 {
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 #define MAXMINPOW(RetType, Type1, Type2) \
45  \
46 MAXMIN(RetType, Type1, Type2) \
47  \
48  \
49 inline double pow(const Type1 base, const Type2 expon) \
50 { \
51  return ::pow(double(base), double(expon)); \
52 }
53 
54 
55 MAXMINPOW(double, double, double)
56 MAXMINPOW(double, double, float)
57 MAXMINPOW(double, float, double)
58 MAXMINPOW(double, double, int)
59 MAXMINPOW(double, int, double)
60 MAXMINPOW(double, double, long)
61 MAXMINPOW(double, long, double)
62 MAXMINPOW(float, float, float)
63 MAXMINPOW(float, float, int)
64 MAXMINPOW(float, int, float)
65 MAXMINPOW(float, float, long)
66 MAXMINPOW(float, long, float)
67 #if defined(__APPLE__) && WM_LABEL_SIZE == 64
68 MAXMINPOW(double, double, int64_t)
69 MAXMINPOW(double, int64_t, double)
70 MAXMINPOW(float, float, int64_t)
71 MAXMINPOW(float, int64_t, float)
72 #endif
73 
74 #undef MAXMINPOW
75 
76 
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78 
79 } // End namespace Foam
80 
81 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
82 
83 #endif
84 
85 // ************************************************************************* //
Traits classes for inner and outer products of primitives.
#define MAXMINPOW(RetType, Type1, Type2)
Definition: doubleFloat.H:37
Namespace for OpenFOAM.