Syntax

TypeScript
import { gcd } from '@opentf/std';

gcd(a: number, b: number): number;

Parameters

NameTypeDescription
anumberThe first integer.
bnumberThe second integer.

Returns

The greatest common divisor.

Examples

TypeScript
gcd(12, 8) //=> 4
gcd(54, 24) //=> 6
Last updated on
Edit this page