# CSJ2K.j2k.util.MathUtil.lcm

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="CSJ2K_j2k_util_MathUtil_lcm_" data-uid="CSJ2K.j2k.util.MathUtil.lcm*">lcm Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="CSJ2K_j2k_util_MathUtil_lcm_" data-uid="CSJ2K.j2k.util.MathUtil.lcm*"></a>
<h4 id="CSJ2K_j2k_util_MathUtil_lcm_System_Int32_System_Int32_" data-uid="CSJ2K.j2k.util.MathUtil.lcm(System.Int32,System.Int32)">lcm(int, int)</h4>
<div class="markdown level1 summary"><p>Method that calculates the Least Common Multiple (LCM) of two strictly
positive integer numbers.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static int lcm(int x1, int x2)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function lcm(x1 As Integer, x2 As Integer) As Integer</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">x1</span></td>
      <td><p>First number</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">x2</span></td>
      <td><p>Second number</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td></td>
    </tr>
  </tbody>
</table>


<a id="CSJ2K_j2k_util_MathUtil_lcm_" data-uid="CSJ2K.j2k.util.MathUtil.lcm*"></a>
<h4 id="CSJ2K_j2k_util_MathUtil_lcm_System_Int32___" data-uid="CSJ2K.j2k.util.MathUtil.lcm(System.Int32[])">lcm(int[])</h4>
<div class="markdown level1 summary"><p>Method that calculates the Least Common Multiple (LCM) of several
positive integer numbers.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static int lcm(int[] x)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function lcm(x As Integer()) As Integer</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a>[]</td>
      <td><span class="parametername">x</span></td>
      <td><p>Array containing the numbers.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
