Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.1 - Русский

Change language to:
English - Français - 日本語 - Português -

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Справка Scilab >> Основные функции > Дискретная математика > lcm

lcm

наименьшее общее кратное (НОК)

Синтаксис

pp = lcm(p)
[pp, fact] = lcm(p)

Аргументы

p

вектор-строка полиномиальных значений p = [p1, ..., pn] либо вектор-строка целочисленных значений (тип 8).

fact

вектор полиномиальных или целочисленных значений (тип 8).

pp

полином или целое число.

Описание

pp=lcm(p) вычисляет наименьшее общее кратное pp вектора полиномиальных значений p.

[pp, fact]=lcm(p) вычисляет дополнительно вектор fact такой, что p .* fact = pp * ones(p).

If p is a set of integers with some negative ones, the returned value pp of their LCM is always positive.

If p is an array of decimal integers, they are priorly converted into int32 before processing.

Примеры

//случай полиномов
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)

Смотрите также

  • gcd — Greatest (positive) Common Divisor
  • bezout — GCD of two polynomials or two integers, by the Bezout method

История

VersionDescription
6.0.1 For input integers possibly negative, the returned LCM is now always positive.
Report an issue
<< gcd Дискретная математика perms >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Feb 12 20:08:34 CET 2018