C# 클래스 Aura.Shared.Util.Math2

A few commonly used math-related functions.
파일 보기 프로젝트 열기: aura-project/aura

공개 메소드들

메소드 설명
Between ( int val, int min, int max ) : bool

Returns true if val is between min and max (incl).

Clamp ( float min, float max, float val ) : float

Returns min, if val is lower than min, max, if val is greater than max, or simply val.

Clamp ( int min, int max, int val ) : int

Returns min, if val is lower than min, max, if val is greater than max, or simply val.

Clamp ( long min, long max, long val ) : long

Returns min, if val is lower than min, max, if val is greater than max, or simply val.

MultiplyChecked ( int initialValue, double multiplicator ) : int

Multiplies initial value with multiplicator, returns either the result or Min/MaxValue if the multiplication caused an overflow.

MultiplyChecked ( long initialValue, double multiplicator ) : long

Multiplies initial value with multiplicator, returns either the result or Min/MaxValue if the multiplication caused an overflow.

MultiplyChecked ( short initialValue, double multiplicator ) : short

Multiplies initial value with multiplicator, returns either the result or Min/MaxValue if the multiplication caused an overflow.

메소드 상세

Between() 공개 정적인 메소드

Returns true if val is between min and max (incl).
public static Between ( int val, int min, int max ) : bool
val int
min int
max int
리턴 bool

Clamp() 공개 정적인 메소드

Returns min, if val is lower than min, max, if val is greater than max, or simply val.
public static Clamp ( float min, float max, float val ) : float
min float
max float
val float
리턴 float

Clamp() 공개 정적인 메소드

Returns min, if val is lower than min, max, if val is greater than max, or simply val.
public static Clamp ( int min, int max, int val ) : int
min int
max int
val int
리턴 int

Clamp() 공개 정적인 메소드

Returns min, if val is lower than min, max, if val is greater than max, or simply val.
public static Clamp ( long min, long max, long val ) : long
min long
max long
val long
리턴 long

MultiplyChecked() 공개 정적인 메소드

Multiplies initial value with multiplicator, returns either the result or Min/MaxValue if the multiplication caused an overflow.
public static MultiplyChecked ( int initialValue, double multiplicator ) : int
initialValue int
multiplicator double
리턴 int

MultiplyChecked() 공개 정적인 메소드

Multiplies initial value with multiplicator, returns either the result or Min/MaxValue if the multiplication caused an overflow.
public static MultiplyChecked ( long initialValue, double multiplicator ) : long
initialValue long
multiplicator double
리턴 long

MultiplyChecked() 공개 정적인 메소드

Multiplies initial value with multiplicator, returns either the result or Min/MaxValue if the multiplication caused an overflow.
public static MultiplyChecked ( short initialValue, double multiplicator ) : short
initialValue short
multiplicator double
리턴 short