mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
feat: Adding MathUtils.Clamp overload for bytes
This commit is contained in:
@@ -10,6 +10,18 @@ namespace ICD.Common.Utils
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static class MathUtils
|
public static class MathUtils
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Clamps the number between the two values.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="number"></param>
|
||||||
|
/// <param name="min"></param>
|
||||||
|
/// <param name="max"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static byte Clamp(byte number, byte min, byte max)
|
||||||
|
{
|
||||||
|
return (byte)Clamp((double)number, min, max);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clamps the number between the two values.
|
/// Clamps the number between the two values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user