9 #ifndef LARCOREALG_COREUTILS_NUMERICUTILS_H 10 #define LARCOREALG_COREUTILS_NUMERICUTILS_H 13 #include <type_traits> 42 template <
typename A,
typename B>
46 std::is_same<std::decay_t<A>, std::decay_t<B>>(),
47 "Arguments of util::absDiff() have to be of the same type." 49 return (b > a)? (b - a): (a - b);
56 #endif // LARCOREALG_COREUTILS_NUMERICUTILS_H Namespace for general, non-LArSoft-specific utilities.
constexpr auto absDiff(A const &a, B const &b)
Returns the absolute value of the difference between two values.