Virtu/Library/MathHelpers.cs
Sean Fausett 9fca4b220f Added audio volume to machine settings.
--HG--
extra : convert_revision : svn%3Affd33b8c-2492-42e0-bdc5-587b920b7d6d/trunk%4047214
2010-06-11 12:00:48 +00:00

21 lines
529 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 double Clamp(double value, double min, double max)
{
return (value < min) ? min : (value > max) ? max : value;
}
public static int ClampByte(int value)
{
return Clamp(value, byte.MinValue, byte.MaxValue);
}
}
}