Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456 最大公約数の取得
最大公約数の取得
Math::Bigintモジュールを使うと最大公約数(GCD: Greatest Common Divisor)を簡単に求めることができます。
use Math::BigInt;
my $gcd = Math::BigInt::bgcd(123456, 42) - 0;
print $gcd, "\n";