11#include <l4/cxx/type_traits>
34constexpr T
gcd(T a, T b)
36 static_assert(Type_traits<T>::is_unsigned,
"Type must be unsigned");
68constexpr T
lcm(T a, T b)
70 static_assert(Type_traits<T>::is_unsigned,
"Type must be unsigned");
75 return (a /
gcd(a, b)) * b;
constexpr T gcd(T a, T b)
Compute the greatest common divisor of two unsigned values.
constexpr T lcm(T a, T b)
Compute the least common multiple of two unsigned values.