Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
NumericPrecision.h
Go to the documentation of this file.
1/* This file is part of MoDELib, the Mechanics Of Defects Evolution Library.
2 *
3 *
4 * MoDELib is distributed without any warranty under the
5 * GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
6 */
7
8#ifndef model_NumericPrecision_H_
9#define model_NumericPrecision_H_
10
11#include <cfloat>
12
13namespace model
14{
15
16 template<typename T>
18 {
19 static constexpr T epsilon=DBL_EPSILON;
20 };
21
22 template<>
23 struct NumericPrecision<double>
24 {
25 static constexpr double epsilon=DBL_EPSILON;
26 };
27
28
29 template<>
30 struct NumericPrecision<float>
31 {
32 static constexpr double epsilon=FLT_EPSILON;
33 };
34
35} // namespace model
36#endif
static constexpr double epsilon
static constexpr double epsilon
static constexpr T epsilon