UNPKG

es-next-tools

Version:

A comprehensive utility library for JavaScript and TypeScript that provides a wide range of functions for common programming tasks, including mathematical operations, date manipulations, array and object handling, string utilities, and more.

10 lines (9 loc) 344 B
/** * Calculates the greatest common divisor (GCD) of two numbers using the Euclidean algorithm. * @param {number} a - The first number. * @param {number} b - The second number. * @returns The greatest common divisor of a and b. * @example * const result = gcd(48, 18); // 6 */ export declare function gcd(a: number, b: number): number;