F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Utils::Algorithms Namespace Reference

Functions

FwSizeType gcd (FwSizeType a, FwSizeType b)
 Calculate the greatest common divisor of two numbers using the Euclidean algorithm. More...
 
FwSizeType lcm (FwSizeType a, FwSizeType b)
 Calculate the least common multiple of two numbers Asserts that a != 0, b != 0, and that the calculated LCM does not overflow FwSizeType. More...
 

Function Documentation

◆ gcd()

FwSizeType Utils::Algorithms::gcd ( FwSizeType  a,
FwSizeType  b 
)

Calculate the greatest common divisor of two numbers using the Euclidean algorithm.

Parameters
afirst number
bsecond number
Returns
greatest common divisor of a and b

Definition at line 19 of file Algorithms.cpp.

◆ lcm()

FwSizeType Utils::Algorithms::lcm ( FwSizeType  a,
FwSizeType  b 
)

Calculate the least common multiple of two numbers Asserts that a != 0, b != 0, and that the calculated LCM does not overflow FwSizeType.

Parameters
afirst number
bsecond number
Returns
least common multiple of a and b

Definition at line 30 of file Algorithms.cpp.