31#ifndef ETL_LCM_INCLUDED
32#define ETL_LCM_INCLUDED
36#include "static_assert.h"
49 lcm(T a, T b) ETL_NOEXCEPT
60 return a * (b / gcd(a, b));
72 lcm(T a, T b) ETL_NOEXCEPT
78 utype ua = etl::absolute_unsigned(a);
79 utype ub = etl::absolute_unsigned(b);
81 return static_cast<T
>(lcm(ua, ub));
85 #if ETL_HAS_INITIALIZER_LIST
91 template<
typename T,
typename... TRest>
94 T lcm(T first, TRest... rest) ETL_NOEXCEPT
98 for (T value : {rest...})
100 result = lcm(result, value);
118 template<
typename T,
typename... TRest>
121 T lcm(T a, T b, TRest... rest) ETL_NOEXCEPT
123 T lcm_ab = lcm(a, b);
133 return lcm(lcm_ab, rest...);
is_integral
Definition type_traits_generator.h:1001
make_unsigned
Definition type_traits_generator.h:1181
bitset_ext
Definition absolute.h:38
pair holds two objects of arbitrary type
Definition utility.h:164