egirlskey/packages/backend/src/prelude/math.ts
syuilo 0e4a111f81 refactoring
Resolve #7779
2021-11-12 02:02:25 +09:00

3 lines
91 B
TypeScript

export function gcd(a: number, b: number): number {
return b === 0 ? a : gcd(b, a % b);
}