# GrapeCity.Documents.Common.IStructComparer-1.Compare

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Common_IStructComparer_1_Compare_" data-uid="GrapeCity.Documents.Common.IStructComparer`1.Compare*">Compare Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Common_IStructComparer_1_Compare_" data-uid="GrapeCity.Documents.Common.IStructComparer`1.Compare*"></a>
<h4 id="GrapeCity_Documents_Common_IStructComparer_1_Compare__0___0__" data-uid="GrapeCity.Documents.Common.IStructComparer`1.Compare(`0@,`0@)">Compare(in T, in T)</h4>
<div class="markdown level1 summary"><p>Compares two structs and returns a value indicating whether one is less than, equal to, or greater than the other.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">int Compare(in T x, in T y)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Function Compare(ByRef x As T, ByRef y As T) 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><span class="xref">T</span></td>
      <td><span class="parametername">x</span></td>
      <td><p>The first struct to compare.</p>
</td>
    </tr>
    <tr>
      <td><span class="xref">T</span></td>
      <td><span class="parametername">y</span></td>
      <td><p>The second struct to compare.</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><p>A signed integer that indicates the relative values of <code class="paramref">x</code> and <code class="paramref">y</code>. Value Meaning Less than 0 <code class="paramref">x</code> is less than <code class="paramref">y</code>. 0 <code class="paramref">x</code> equals <code class="paramref">y</code>. Greater than 0 <code class="paramref">x</code> is greater than <code class="paramref">y</code>.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
