Kea  2.3.5-git
doubles.h
Go to the documentation of this file.
1 // Copyright (C) 2019 Internet Systems Consortium, Inc. ("ISC")
2 //
3 // This Source Code Form is subject to the terms of the Mozilla Public
4 // License, v. 2.0. If a copy of the MPL was not distributed with this
5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 
7 #ifndef DOUBLES_H
8 #define DOUBLES_H
9 
10 #include <complex>
11 
12 namespace isc {
13 namespace util {
14 
22 inline bool areDoublesEquivalent(double a, double b, double tolerance=0.000001) {
23  return(std::abs(a - b) < tolerance);
24 }
25 
26 } // namespace util
27 } // namespace isc
28 
29 #endif // DOUBLES_H
bool areDoublesEquivalent(double a, double b, double tolerance=0.000001)
Tests two doubles for equivalence within a given tolerance.
Definition: doubles.h:22
Defines the logger used by the top-level component of kea-lfc.