C# Class SilverFlow.Controls.Extensions.MathExtensions

Math extensions
显示文件 Open project: Zoomicon/ZUI

Public Methods

Method Description
AbsMin ( double num1, double num2 ) : double

Compares two numbers without their signs and gets absolutely minimal value.

EnsureInRange ( this number, double low, double high ) : double

Ensures the given number is in the specified range.

IsNear ( this number, double testNumber, double accuracy ) : bool

Determines whether the specified number is near the test number.

IsNotSet ( this number ) : bool

Determines whether the number is NaN.

ValueOrZero ( this number ) : double

Returns a double value if it is not a NAN, or zero.

Method Details

AbsMin() public static method

Compares two numbers without their signs and gets absolutely minimal value.
public static AbsMin ( double num1, double num2 ) : double
num1 double First number.
num2 double Second number.
return double

EnsureInRange() public static method

Ensures the given number is in the specified range.
public static EnsureInRange ( this number, double low, double high ) : double
number this The number.
low double The lower limit.
high double The upper limit.
return double

IsNear() public static method

Determines whether the specified number is near the test number.
public static IsNear ( this number, double testNumber, double accuracy ) : bool
number this The number.
testNumber double The test number.
accuracy double Accuracy.
return bool

IsNotSet() public static method

Determines whether the number is NaN.
public static IsNotSet ( this number ) : bool
number this The number.
return bool

ValueOrZero() public static method

Returns a double value if it is not a NAN, or zero.
public static ValueOrZero ( this number ) : double
number this The number.
return double