fn gcd(vm: &mut VM, self_val: Value, args: &Args2) -> VMResult {
    args.check_args_num(1)?;
    let rhs = vm[0];
    if let Some(i) = self_val.as_fixnum() {
        let res = if let Some(b2) = rhs.as_bignum() {
            Value::bignum(BigInt::from(i).gcd(b2))
        } else if let Some(i2) = rhs.as_fixnum() {
            arith::safe_gcd(&i, &i2)
        } else {
            return Err(VMError::cant_coerse(rhs, "Integer"));
        };
        Ok(res)
    } else if let Some(b) = self_val.as_bignum() {
        let res = if let Some(b2) = rhs.as_bignum() {
            b.gcd(b2)
        } else if let Some(i2) = rhs.as_fixnum() {
            b.gcd(&BigInt::from(i2))
        } else {
            return Err(VMError::cant_coerse(rhs, "Integer"));
        };
        Ok(Value::bignum(res))
    } else {
        unreachable!()
    }
}
gcd(n) -> Integer

https://docs.ruby-lang.org/ja/latest/method/Integer/i/gcd.html
ruruby/src/builtin/integer.rs