Chebyshev
Unit testing for scientific software
Loading...
Searching...
No Matches
distance.h
Go to the documentation of this file.
1
5
6#ifndef CHEBYSHEV_DISTANCE_H
7#define CHEBYSHEV_DISTANCE_H
8
9
10namespace chebyshev {
11
12namespace _internal {
13
14 template<typename Type>
15 inline Type abs(Type x) {
16 return (x > 0) ? x : -x;
17 }
18}
19
20namespace prec {
21
23 namespace distance {
24
26 template<typename Type = double>
27 inline Type abs_distance(Type a, Type b) {
28 return _internal::abs(b - a);
29 }
30
31 }
32
33}}
34
35#endif
Type abs_distance(Type a, Type b)
Absolute distance between two real values.
Definition distance.h:27
General namespace of the framework.
Definition benchmark.h:22
constexpr FloatType get_nan()
Get a quiet NaN of the specified floating point type.
Definition common.h:65