1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-24 19:28:46 +00:00
X10D/api/X10D.Math.ComparableExtensions.html
2024-06-12 13:17:02 +00:00

856 lines
35 KiB
HTML

<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class ComparableExtensions
| X10D </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class ComparableExtensions
| X10D ">
<meta name="generator" content="docfx 2.56.7.0">
<link rel="shortcut icon" href="../images/favicon.png">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/night-owl.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css" integrity="sha384-EvBWSlnoFgZlXJvpzS+MAUEjvN7+gcCwH+qh7GRFOGgZO0PuwOFro7qPOJnLfe7l" crossorigin="anonymous">
<link rel="stylesheet" href="../styles/config.css">
<link rel="stylesheet" href="../styles/discord.css">
<link rel="stylesheet" href="../styles/singulink.css">
<link rel="stylesheet" href="../styles/main.css">
<meta property="docfx:navrel" content="../toc.html">
<meta property="docfx:tocrel" content="toc.html">
<meta property="docfx:rel" content="../">
<meta property="docfx:newtab" content="true">
</head>
<body>
<div class="top-navbar">
<a class="burger-icon" onclick="toggleMenu()">
<svg name="Hamburger" style="vertical-align: middle;" width="34" height="34" viewbox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M20 6H4V9H20V6ZM4 10.999H20V13.999H4V10.999ZM4 15.999H20V18.999H4V15.999Z"></path></svg>
</a>
<a class="brand" href="../index.html">
<img src="../images/favicon.png" alt="X10D" class="logomark">
<span class="brand-title">X10D</span>
</a> </div>
<div class="body-content">
<div id="blackout" class="blackout" onclick="toggleMenu()"></div>
<nav id="sidebar" role="navigation">
<div class="sidebar">
<div>
<div class="mobile-hide">
<a class="brand" href="../index.html">
<img src="../images/favicon.png" alt="X10D" class="logomark">
<span class="brand-title">X10D</span>
</a> </div>
<div class="sidesearch">
<form id="search" role="search" class="search">
<i class="bi bi-search search-icon"></i>
<input type="text" id="search-query" placeholder="Search" autocomplete="off">
</form>
</div>
<div id="navbar">
</div>
</div> <div class="sidebar-item-separator"></div>
<div id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="footer">
<strong>DocFX + Singulink = ♥</strong>
</div> </nav>
<main class="main-panel">
<div id="search-results" style="display: none;">
<h1 class="search-list">Search Results for <span></span></h1>
<div class="sr-items">
<p><i class="bi bi-hourglass-split index-loading"></i></p>
</div>
<ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
</div>
<div role="main" class="hide-when-search">
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
<article class="content wrap" id="_content" data-uid="X10D.Math.ComparableExtensions">
<h1 id="X10D_Math_ComparableExtensions" data-uid="X10D.Math.ComparableExtensions" class="text-break">Class ComparableExtensions
</h1>
<div class="markdown level0 summary"><p>Extension methods for <see cref="!:IComparable&lt;T>"></see>.</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><span class="xref">System.Object</span></div>
<div class="level1"><span class="xref">ComparableExtensions</span></div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="X10D.Math.html">X10D.Math</a></h6>
<h6><strong>Assembly</strong>: X10D.dll</h6>
<h5 id="X10D_Math_ComparableExtensions_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static class ComparableExtensions : object</code></pre>
</div>
<h3 id="methods">Methods
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Math_ComparableExtensions_Between__3___0___1___2_X10D_Math_InclusiveOptions_.md&amp;value=---%0Auid%3A%20X10D.Math.ComparableExtensions.Between%60%603(%60%600%2C%60%601%2C%60%602%2CX10D.Math.InclusiveOptions)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Math/ComparableExtensions.cs/#L51">View Source</a>
</span>
<a id="X10D_Math_ComparableExtensions_Between_" data-uid="X10D.Math.ComparableExtensions.Between*"></a>
<h4 id="X10D_Math_ComparableExtensions_Between__3___0___1___2_X10D_Math_InclusiveOptions_" data-uid="X10D.Math.ComparableExtensions.Between``3(``0,``1,``2,X10D.Math.InclusiveOptions)">Between&lt;T1, T2, T3&gt;(T1, T2, T3, InclusiveOptions)</h4>
<div class="markdown level1 summary"><p>Determines if a specified value falls exclusively between a specified lower bound and upper bound.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool Between&lt;T1, T2, T3&gt;(this T1 value, T2 lower, T3 upper, InclusiveOptions inclusiveOptions = default(InclusiveOptions))
where T1 : IComparable&lt;T2&gt;, IComparable&lt;T3&gt; where T2 : IComparable&lt;T3&gt; where T3 : IComparable&lt;T2&gt;</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T1</span></td>
<td><span class="parametername">value</span></td>
<td><p>The value to compare.</p>
</td>
</tr>
<tr>
<td><span class="xref">T2</span></td>
<td><span class="parametername">lower</span></td>
<td><p>The exclusive lower bound.</p>
</td>
</tr>
<tr>
<td><span class="xref">T3</span></td>
<td><span class="parametername">upper</span></td>
<td><p>The exclusive upper bound.</p>
</td>
</tr>
<tr>
<td><a class="xref" href="X10D.Math.InclusiveOptions.html">InclusiveOptions</a></td>
<td><span class="parametername">inclusiveOptions</span></td>
<td><p>The comparison clusivity.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p><span class="xref">true</span> if <code data-dev-comment-type="paramref" class="paramref">value</code> is between the <code data-dev-comment-type="paramref" class="paramref">lower</code> and
<code data-dev-comment-type="paramref" class="paramref">upper</code>
-or-
<span class="xref">false</span> otherwise.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T1</span></td>
<td><p>An <see cref="!:IComparable&lt;T2>"></see> type.</p>
</td>
</tr>
<tr>
<td><span class="parametername">T2</span></td>
<td><p>The first comparison operand type.</p>
</td>
</tr>
<tr>
<td><span class="parametername">T3</span></td>
<td><p>The second comparison operand type.</p>
</td>
</tr>
</tbody>
</table>
<h5 id="X10D_Math_ComparableExtensions_Between__3___0___1___2_X10D_Math_InclusiveOptions__examples">Examples</h5>
<pre><code>int firstValue = 42;
int secondValue = 15;
int lower = 0;
int upper = 20;
Console.WriteLine($&quot;{firstValue} between {lower} and {upper}?&quot;);
Console.WriteLine(firstValue.Between(lower, upper));
Console.WriteLine($&quot;{secondValue} between {lower} and {upper}?&quot;);
Console.WriteLine(secondValue.Between(lower, upper));
// This will output the following:
// 42 between 0 and 20?
// False
// 15 between 0 and 20?
// True</code></pre>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Math_ComparableExtensions_Clamp__1___0___0___0_.md&amp;value=---%0Auid%3A%20X10D.Math.ComparableExtensions.Clamp%60%601(%60%600%2C%60%600%2C%60%600)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Math/ComparableExtensions.cs/#L108">View Source</a>
</span>
<a id="X10D_Math_ComparableExtensions_Clamp_" data-uid="X10D.Math.ComparableExtensions.Clamp*"></a>
<h4 id="X10D_Math_ComparableExtensions_Clamp__1___0___0___0_" data-uid="X10D.Math.ComparableExtensions.Clamp``1(``0,``0,``0)">Clamp&lt;T&gt;(T, T, T)</h4>
<div class="markdown level1 summary"><p>Returns the current value clamped to the inclusive range of <code data-dev-comment-type="paramref" class="paramref">lower</code> and <code data-dev-comment-type="paramref" class="paramref">upper</code>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static T Clamp&lt;T&gt;(this T value, T lower, T upper)
where T : IComparable&lt;T&gt;</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped 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">value</span></td>
<td><p>The value to be clamped.</p>
</td>
</tr>
<tr>
<td><span class="xref">T</span></td>
<td><span class="parametername">lower</span></td>
<td><p>The lower bound of the result.</p>
</td>
</tr>
<tr>
<td><span class="xref">T</span></td>
<td><span class="parametername">upper</span></td>
<td><p>The upper bound of the result.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T</span></td>
<td><p><code data-dev-comment-type="paramref" class="paramref">value</code> if <code data-dev-comment-type="paramref" class="paramref">lower</code><code data-dev-comment-type="paramref" class="paramref">value</code><code data-dev-comment-type="paramref" class="paramref">upper</code>.
-or-
<code data-dev-comment-type="paramref" class="paramref">lower</code> if <code data-dev-comment-type="paramref" class="paramref">value</code> &lt; <code data-dev-comment-type="paramref" class="paramref">lower</code>.
-or-
<code data-dev-comment-type="paramref" class="paramref">upper</code> if <code data-dev-comment-type="paramref" class="paramref">upper</code> &lt; <code data-dev-comment-type="paramref" class="paramref">value</code>.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>An <see cref="!:IComparable"></see> type.</p>
</td>
</tr>
</tbody>
</table>
<h5 id="X10D_Math_ComparableExtensions_Clamp__1___0___0___0__examples">Examples</h5>
<pre><code>int value = 42;
int lower = 0;
int upper = 20;
int clamped = value.Clamp(lower, upper);
// clamped will be 20</code></pre>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Math_ComparableExtensions_GreaterThan__2___0___1_.md&amp;value=---%0Auid%3A%20X10D.Math.ComparableExtensions.GreaterThan%60%602(%60%600%2C%60%601)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Math/ComparableExtensions.cs/#L150">View Source</a>
</span>
<a id="X10D_Math_ComparableExtensions_GreaterThan_" data-uid="X10D.Math.ComparableExtensions.GreaterThan*"></a>
<h4 id="X10D_Math_ComparableExtensions_GreaterThan__2___0___1_" data-uid="X10D.Math.ComparableExtensions.GreaterThan``2(``0,``1)">GreaterThan&lt;T1, T2&gt;(T1, T2)</h4>
<div class="markdown level1 summary"><p>Determines if the current value is greater than another value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool GreaterThan&lt;T1, T2&gt;(this T1 value, T2 other)
where T1 : IComparable&lt;T2&gt;</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T1</span></td>
<td><span class="parametername">value</span></td>
<td><p>The first value.</p>
</td>
</tr>
<tr>
<td><span class="xref">T2</span></td>
<td><span class="parametername">other</span></td>
<td><p>The second value.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p><span class="xref">true</span> if <code data-dev-comment-type="paramref" class="paramref">value</code> is greater than <code data-dev-comment-type="paramref" class="paramref">other</code>
-or-
<span class="xref">false</span> otherwise.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T1</span></td>
<td><p>An <see cref="!:IComparable&lt;T2>"></see> type.</p>
</td>
</tr>
<tr>
<td><span class="parametername">T2</span></td>
<td><p>The comparison operand type.</p>
</td>
</tr>
</tbody>
</table>
<h5 id="X10D_Math_ComparableExtensions_GreaterThan__2___0___1__examples">Examples</h5>
<pre><code>int first = 5;
int second = 10;
bool result = first.GreaterThan(second);
// result will be False</code></pre>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Math_ComparableExtensions_GreaterThanOrEqualTo__2___0___1_.md&amp;value=---%0Auid%3A%20X10D.Math.ComparableExtensions.GreaterThanOrEqualTo%60%602(%60%600%2C%60%601)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Math/ComparableExtensions.cs/#L185">View Source</a>
</span>
<a id="X10D_Math_ComparableExtensions_GreaterThanOrEqualTo_" data-uid="X10D.Math.ComparableExtensions.GreaterThanOrEqualTo*"></a>
<h4 id="X10D_Math_ComparableExtensions_GreaterThanOrEqualTo__2___0___1_" data-uid="X10D.Math.ComparableExtensions.GreaterThanOrEqualTo``2(``0,``1)">GreaterThanOrEqualTo&lt;T1, T2&gt;(T1, T2)</h4>
<div class="markdown level1 summary"><p>Determines if the current value is greater than or equal to another value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool GreaterThanOrEqualTo&lt;T1, T2&gt;(this T1 value, T2 other)
where T1 : IComparable&lt;T2&gt;</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T1</span></td>
<td><span class="parametername">value</span></td>
<td><p>The first value.</p>
</td>
</tr>
<tr>
<td><span class="xref">T2</span></td>
<td><span class="parametername">other</span></td>
<td><p>The second value.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p><span class="xref">true</span> if <code data-dev-comment-type="paramref" class="paramref">value</code> is greater than or equal to <code data-dev-comment-type="paramref" class="paramref">other</code>
-or-
<span class="xref">false</span> otherwise.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T1</span></td>
<td><p>An <see cref="!:IComparable&lt;T2>"></see> type.</p>
</td>
</tr>
<tr>
<td><span class="parametername">T2</span></td>
<td><p>The comparison operand type.</p>
</td>
</tr>
</tbody>
</table>
<h5 id="X10D_Math_ComparableExtensions_GreaterThanOrEqualTo__2___0___1__examples">Examples</h5>
<pre><code>int first = 5;
int second = 10;
bool result = first.GreaterThanOrEqualTo(second);
// result will be False</code></pre>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Math_ComparableExtensions_LessThan__2___0___1_.md&amp;value=---%0Auid%3A%20X10D.Math.ComparableExtensions.LessThan%60%602(%60%600%2C%60%601)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Math/ComparableExtensions.cs/#L220">View Source</a>
</span>
<a id="X10D_Math_ComparableExtensions_LessThan_" data-uid="X10D.Math.ComparableExtensions.LessThan*"></a>
<h4 id="X10D_Math_ComparableExtensions_LessThan__2___0___1_" data-uid="X10D.Math.ComparableExtensions.LessThan``2(``0,``1)">LessThan&lt;T1, T2&gt;(T1, T2)</h4>
<div class="markdown level1 summary"><p>Determines if the current value is less than another value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool LessThan&lt;T1, T2&gt;(this T1 value, T2 other)
where T1 : IComparable&lt;T2&gt;</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T1</span></td>
<td><span class="parametername">value</span></td>
<td><p>The first value.</p>
</td>
</tr>
<tr>
<td><span class="xref">T2</span></td>
<td><span class="parametername">other</span></td>
<td><p>The second value.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p><span class="xref">true</span> if <code data-dev-comment-type="paramref" class="paramref">value</code> is less than <code data-dev-comment-type="paramref" class="paramref">other</code>
-or-
<span class="xref">false</span> otherwise.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T1</span></td>
<td><p>An <see cref="!:IComparable&lt;T2>"></see> type.</p>
</td>
</tr>
<tr>
<td><span class="parametername">T2</span></td>
<td><p>The comparison operand type.</p>
</td>
</tr>
</tbody>
</table>
<h5 id="X10D_Math_ComparableExtensions_LessThan__2___0___1__examples">Examples</h5>
<pre><code>int first = 5;
int second = 10;
bool result = first.LessThan(second);
// result will be True</code></pre>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Math_ComparableExtensions_LessThanOrEqualTo__2___0___1_.md&amp;value=---%0Auid%3A%20X10D.Math.ComparableExtensions.LessThanOrEqualTo%60%602(%60%600%2C%60%601)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Math/ComparableExtensions.cs/#L255">View Source</a>
</span>
<a id="X10D_Math_ComparableExtensions_LessThanOrEqualTo_" data-uid="X10D.Math.ComparableExtensions.LessThanOrEqualTo*"></a>
<h4 id="X10D_Math_ComparableExtensions_LessThanOrEqualTo__2___0___1_" data-uid="X10D.Math.ComparableExtensions.LessThanOrEqualTo``2(``0,``1)">LessThanOrEqualTo&lt;T1, T2&gt;(T1, T2)</h4>
<div class="markdown level1 summary"><p>Determines if the current value is less than or equal to another value.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static bool LessThanOrEqualTo&lt;T1, T2&gt;(this T1 value, T2 other)
where T1 : IComparable&lt;T2&gt;</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T1</span></td>
<td><span class="parametername">value</span></td>
<td><p>The first value.</p>
</td>
</tr>
<tr>
<td><span class="xref">T2</span></td>
<td><span class="parametername">other</span></td>
<td><p>The second value.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p><span class="xref">true</span> if <code data-dev-comment-type="paramref" class="paramref">value</code> is less than or equal to <code data-dev-comment-type="paramref" class="paramref">other</code>
-or-
<span class="xref">false</span> otherwise.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T1</span></td>
<td><p>An <see cref="!:IComparable&lt;T2>"></see> type.</p>
</td>
</tr>
<tr>
<td><span class="parametername">T2</span></td>
<td><p>The comparison operand type.</p>
</td>
</tr>
</tbody>
</table>
<h5 id="X10D_Math_ComparableExtensions_LessThanOrEqualTo__2___0___1__examples">Examples</h5>
<pre><code>int first = 5;
int second = 10;
bool result = first.LessThanOrEqualTo(second);
// result will be True</code></pre>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Math_ComparableExtensions_Max__1___0___0_.md&amp;value=---%0Auid%3A%20X10D.Math.ComparableExtensions.Max%60%601(%60%600%2C%60%600)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Math/ComparableExtensions.cs/#L289">View Source</a>
</span>
<a id="X10D_Math_ComparableExtensions_Max_" data-uid="X10D.Math.ComparableExtensions.Max*"></a>
<h4 id="X10D_Math_ComparableExtensions_Max__1___0___0_" data-uid="X10D.Math.ComparableExtensions.Max``1(``0,``0)">Max&lt;T&gt;(T, T)</h4>
<div class="markdown level1 summary"><p>Returns the maximum of two values.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static T Max&lt;T&gt;(this T value, T other)
where T : IComparable&lt;T&gt;</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped 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">value</span></td>
<td><p>The first value.</p>
</td>
</tr>
<tr>
<td><span class="xref">T</span></td>
<td><span class="parametername">other</span></td>
<td><p>The second value.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T</span></td>
<td><p><code data-dev-comment-type="paramref" class="paramref">value</code> if <code data-dev-comment-type="paramref" class="paramref">value</code> is greater than <code data-dev-comment-type="paramref" class="paramref">other</code>
-or-
<code data-dev-comment-type="paramref" class="paramref">other</code> otherwise.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>A type which implements <see cref="!:IComparable&lt;T>"></see>.</p>
</td>
</tr>
</tbody>
</table>
<h5 id="X10D_Math_ComparableExtensions_Max__1___0___0__examples">Examples</h5>
<pre><code>int first = 5;
int second = 10;
int max = first.Max(second);
// max will be 10</code></pre>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/oliverbooth/X10D/new/main/apiSpec/new?filename=X10D_Math_ComparableExtensions_Min__1___0___0_.md&amp;value=---%0Auid%3A%20X10D.Math.ComparableExtensions.Min%60%601(%60%600%2C%60%600)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/oliverbooth/X10D/blob/main/X10D/src/Math/ComparableExtensions.cs/#L323">View Source</a>
</span>
<a id="X10D_Math_ComparableExtensions_Min_" data-uid="X10D.Math.ComparableExtensions.Min*"></a>
<h4 id="X10D_Math_ComparableExtensions_Min__1___0___0_" data-uid="X10D.Math.ComparableExtensions.Min``1(``0,``0)">Min&lt;T&gt;(T, T)</h4>
<div class="markdown level1 summary"><p>Returns the minimum of two values.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public static T Min&lt;T&gt;(this T value, T other)
where T : IComparable&lt;T&gt;</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped 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">value</span></td>
<td><p>The first value.</p>
</td>
</tr>
<tr>
<td><span class="xref">T</span></td>
<td><span class="parametername">other</span></td>
<td><p>The second value.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T</span></td>
<td><p><code data-dev-comment-type="paramref" class="paramref">value</code> if <code data-dev-comment-type="paramref" class="paramref">value</code> is less than <code data-dev-comment-type="paramref" class="paramref">other</code>
-or-
<code data-dev-comment-type="paramref" class="paramref">other</code> otherwise.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>A type which implements <see cref="!:IComparable&lt;T>"></see>.</p>
</td>
</tr>
</tbody>
</table>
<h5 id="X10D_Math_ComparableExtensions_Min__1___0___0__examples">Examples</h5>
<pre><code>int first = 5;
int second = 10;
int min = first.Min(second);
// min will be 5</code></pre>
</article>
</div>
<div class="copyright-footer">
<span>&#169; Singulink. All rights reserved.</span>
</div>
</main>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js"></script>
<script type="text/javascript" src="../styles/jquery.twbsPagination.js"></script>
<script type="text/javascript" src="../styles/url.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/anchor-js/anchor.min.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/singulink.js"></script>
<script type="text/javascript" src="../styles/main.js"></script> </body>
</html>