28 lines
353 B
C
28 lines
353 B
C
/*
|
|
* ConfigCalculate.c
|
|
*
|
|
* Created on: 2019年3月15日
|
|
* Author: TiferKing
|
|
*/
|
|
|
|
#include "ConfigCalculate.h"
|
|
|
|
__weak u64 GreatestCommonDivisor(u64 a, u64 b)
|
|
{
|
|
u64 c;
|
|
while(b != 0)
|
|
{
|
|
c = a % b;
|
|
a = b;
|
|
b = c;
|
|
}
|
|
return a;
|
|
}
|
|
|
|
__weak u64 LeastCommonMultiple(u64 a, u64 b)
|
|
{
|
|
u64 c;
|
|
c = GreatestCommonDivisor(a,b);
|
|
return a / c * b;
|
|
}
|