<< gcd Discrete mathematics perms >>

Scilabヘルプ >> Elementary Functions > Discrete mathematics > lcm

lcm

最小公倍数

呼び出し手順

[pp, fact] = lcm(p)

引数

p

多項式行ベクトル p = [p1, ..., pn] (2型) または 整数行ベクトル (8型).

fact

多項式ベクトルまたは整数ベクトル

pp

多項式または整数

説明

pp = lcm(p) は,多項式ベクトルp の最小公倍数ppを計算します.

[pp, fact] = lcm(p) は,これに加えて以下のような ベクトルfactを計算します:

p.*fact = pp*ones(p)

実数の配列pの最小公倍数は, lcmをコールする前にp = inv_coeff(p, 0)により 多項式に変換することにより得られます.

//多項式の場合
s=poly(0,'s');
p=[s,s*(s+1)^2,s^2*(s+2)];
[pp,fact]=lcm(p);
p.*fact, pp
//整数の場合
V=int32([2^2*3^5, 2^3*3^2,2^2*3^4*5]);
lcm(V)

参照


Report an issue
<< gcd Discrete mathematics perms >>