Ruby 1.9.0 リファレンスマニュアル > ライブラリ一覧 > library mathn > class Integer > gcd2

singleton method Integer.gcd2

gcd2(int) [added by mathn]

self と int の最大公約数を求めます。

例:

12.gcd2 8
# => 4