📜  最大公因数 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:22.988000             🧑  作者: Mango

代码示例1
/* Function using "Euclidian Algorithm" to recursively find the 
greatest common divisor/factor (GCD/GCF) of 2 positive numbers*/
const gcf = function (small, large) {
    let r = large % small;
    if (r == 0)
        return small;
    else
        return gcf(r, small);
}