mirror of
https://github.com/digital-jellyfish/Virtu.git
synced 2024-11-23 19:30:59 +00:00
fe9abb1c2b
Added signature to machine state. Changed floating point precision from double to single.
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);
|
|
}
|
|
}
|
|
}
|