Line data Source code
1 : #pragma once
2 :
3 : #include <AH/Math/FixArduinoMacros.hpp>
4 :
5 : #include <AH/Settings/NamespaceSettings.hpp>
6 :
7 : BEGIN_AH_NAMESPACE
8 :
9 : /// Return the smaller of two numbers/objects.
10 : /// @ingroup AH_Math
11 : template <class T, class U>
12 1000003 : constexpr auto min(const T &a, const U &b) -> decltype(b < a ? b : a) {
13 1000003 : return b < a ? b : a;
14 : }
15 :
16 : /// Return the larger of two numbers/objects.
17 : /// @ingroup AH_Math
18 : template <class T, class U>
19 5240 : constexpr auto max(const T &a, const U &b) -> decltype(a < b ? b : a) {
20 5240 : return a < b ? b : a;
21 : }
22 :
23 : END_AH_NAMESPACE
|