31#ifndef ETL_LCM_INCLUDED
32#define ETL_LCM_INCLUDED
36#include "static_assert.h"
45 template <
intmax_t A,
intmax_t B>
59 lcm(
T a,
T b) ETL_NOEXCEPT
70 return a * (
b / gcd(a,
b));
82 lcm(
T a,
T b) ETL_NOEXCEPT
88 utype ua = etl::absolute_unsigned(a);
89 utype ub = etl::absolute_unsigned(
b);
91 return static_cast<T>(lcm(
ua,
ub));
95 #if ETL_HAS_INITIALIZER_LIST
101 template<
typename T,
typename...
TRest>
108 for (
T value : {
rest...})
110 result = lcm(result, value);
128 template<
typename T,
typename...
TRest>
enable_if
Definition type_traits_generator.h:1230
is_integral
Definition type_traits_generator.h:1040
make_unsigned
Definition type_traits_generator.h:1220
bitset_ext
Definition absolute.h:38
ETL_NODISCARD ETL_CONSTEXPR14 T round_half_even_unscaled(T value) ETL_NOEXCEPT
Definition scaled_rounding.h:314