17 namespace Algorithms {
20 const FwSizeType maxIterations =
static_cast<FwSizeType>(std::numeric_limits<FwSizeType>::digits) * 2;
21 for (
FwSizeType i = 0; (i < maxIterations) && (b != 0); i++) {
36 FW_ASSERT((std::numeric_limits<FwSizeType>::max() / b) >= a_div_g, static_cast<FwAssertArgType>(a),
37 static_cast<FwAssertArgType>(b));
PlatformSizeType FwSizeType
FwSizeType lcm(FwSizeType a, FwSizeType b)
Calculate the least common multiple of two numbers Asserts that a != 0, b != 0, and that the calculat...
FwSizeType gcd(FwSizeType a, FwSizeType b)
Calculate the greatest common divisor of two numbers using the Euclidean algorithm.