最小公倍数の取得
Math::Bigintモジュールを使うと最小公倍数(LCM: Least Common Multiple)を簡単に求めることができます。
use strict; use warnings; use v5.10; use Math::BigInt; my $lcm = Math::BigInt::blcm(12, 18, 20); say $lcm; # 180
use strict; use warnings; use v5.10; use Math::BigInt; my $lcm = Math::BigInt::blcm(12, 18, 20); say $lcm; # 180