Chebyshev
Unit testing for scientific software
distance.h
Go to the documentation of this file.
1 
5 
6 #ifndef CHEBYSHEV_DISTANCE_H
7 #define CHEBYSHEV_DISTANCE_H
8 
9 
10 namespace chebyshev {
11 namespace prec {
12 
14  namespace distance {
15 
16 
18  template<typename FloatType = double>
19  inline FloatType abs_distance(FloatType a, FloatType b) {
20 
21  const FloatType diff = b - a;
22  return (diff > 0) ? diff : -diff;
23  }
24 
25 
26  }
27 
28 }}
29 
30 #endif
FloatType abs_distance(FloatType a, FloatType b)
Absolute distance between two real values.
Definition: distance.h:19
General namespace of the framework.
Definition: benchmark_structures.h:16