Apachai.Effects.Core.Utility.Clamp C# (CSharp) 메소드

Clamp() 공개 정적인 메소드

public static Clamp ( double x, double min, double max ) : double
x double
min double
max double
리턴 double
        public static double Clamp(double x, double min, double max)
        {
            if (x < min) {
                return min;
            } else if (x > max) {
                return max;
            } else {
                return x;
            }
        }

Same methods

Utility::Clamp ( float x, float min, float max ) : float
Utility::Clamp ( int x, int min, int max ) : int