MCPcopy Create free account
hub / github.com/comaps/comaps / GCD

Function GCD

libs/base/math.hpp:159–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157// Greatest Common Divisor.
158template <typename Number, typename EnableIf = typename std::enable_if_t<std::is_integral_v<Number>, void>>
159Number constexpr GCD(Number const a, Number const b)
160{
161 return b == 0 ? a : GCD(b, a % b);
162}
163
164// Least Common Multiple.
165template <typename Number, typename EnableIf = typename std::enable_if_t<std::is_integral_v<Number>, void>>

Callers 2

LCMFunction · 0.85
UNIT_TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

UNIT_TESTFunction · 0.68