mirror of
https://github.com/digital-jellyfish/Virtu.git
synced 2024-11-30 20:49:26 +00:00
eaaab47a6c
--HG-- extra : convert_revision : svn%3Affd33b8c-2492-42e0-bdc5-587b920b7d6d/trunk%4019155
16 lines
380 B
C#
16 lines
380 B
C#
namespace Jellyfish.Library
|
|
{
|
|
public static class MathHelpers
|
|
{
|
|
public static int Clamp(int value, int min, int max)
|
|
{
|
|
return (value < min) ? min : (value > max) ? max : value;
|
|
}
|
|
|
|
public static int ClampByte(int value)
|
|
{
|
|
return Clamp(value, byte.MinValue, byte.MaxValue);
|
|
}
|
|
}
|
|
}
|