Virtu/Library/MathHelpers.cs
Sean Fausett 27a5e3ac89 Add git attributes file.
Normalize text files.
2013-06-18 16:52:34 +12:00

16 lines
365 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);
}
}
}