13#ifndef ML_NUMERIC_HELPERS_H
14#define ML_NUMERIC_HELPERS_H
25 template <
typename T, std::
size_t N>
constexpr T convertTo(
const char (&t)[
N])
27 static_assert(
N - 1 ==
sizeof(
T),
"Illegal character sequence for type T");
29 for (
auto index = 0u; index <
N - 1; ++index)
45 static_assert(std::is_floating_point_v<T>,
"Deduced type T should be a floating point type");
48 auto diff = std::fabs(x - y);
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
Main documentation file for ML users and developers.
constexpr T convertTo(const char(&t)[N])
constexpr bool almostEqualRelativeAndAbs(T x, T y, T absoluteEpsilon, T relativeEpsilon=std::numeric_limits< T >::epsilon())