1 #ifndef VCSN_MISC_MATH_HH
2 # define VCSN_MISC_MATH_HH
14 unsigned int gcd(
unsigned int a,
unsigned int b)
16 require(b,
"gcd: rhs cannot be zero");
29 unsigned int lcm(
unsigned int a,
unsigned int b)
31 return a /
gcd(a, b) *
b;
36 #endif // VCSN_MISC_MATH_HH
ATTRIBUTE_PURE unsigned int lcm(unsigned int a, unsigned int b)
ATTRIBUTE_PURE unsigned int gcd(unsigned int a, unsigned int b)
variadic_mul_mixin< detail::b_impl > b
Provide a variadic mul on top of a binary mul(), and one().
void require(bool b, Args &&...args)
If b is not verified, raise an error with args as message.