Pixel-Composer/scripts/real_number_functions/real_number_functions.gml
2023-12-04 18:09:31 +07:00

13 lines
289 B
Plaintext

function GCD(num1, num2) {
if(num1 * num2 == 0) return 0;
if (num2 == 0) return num1;
else return GCD(num2, num1 % num2);
}
function GCDs(num1, num2) {
if(num1 == num2) return 0;
if(num1 % num2 == 0) return num2;
if(num2 % num1 == 0) return num1;
return 0;
}