method

gcd

v1_8_6_287 - Show latest stable - Class: Integer
gcd(other)
public

Returns the greatest common denominator of the two numbers (self and n).

Examples:

  72.gcd 168           # -> 24
  19.gcd 36            # -> 1

The result is positive, no matter the sign of the arguments.