HILA
Loading...
Searching...
No Matches
floating_point_epsilon.h
Go to the documentation of this file.
1/** @file floating_point_epsilon.h */
2
3#ifndef FLOATING_POINT_EPSILON_H_
4#define FLOATING_POINT_EPSILON_H_
5
6template <typename T>
7struct fp {
8 static constexpr T epsilon=0;
9};
10
11template <>
12struct fp<long double> {
13 static constexpr long double epsilon=1.0842e-19;
14};
15
16template <>
17struct fp<double> {
18 static constexpr double epsilon=2.22045e-16;
19};
20
21template <>
22struct fp<float> {
23 static constexpr float epsilon=1.19209e-07f;
24};
25
26#endif