Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

gcd

Calculate the greatest common divisor for n numbers

Arguments

  • n - The array of numbers to calculate the gcd for

Returns

  • felt252 - The gcd of input numbers

Fully qualified path: alexandria_math::gcd_of_n_numbers::gcd

pub fn gcd(mut n: Span<u128>) -> u128