Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/ExternalCoreProjects/Virtu/Library/MathHelpers.cs
2 views
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);
        }
    }
}