C# 클래스 MS.Internal.DoubleUtil

파일 보기 프로젝트 열기: kasicass/kasicass 1 사용 예제들

공개 메소드들

메소드 설명
AreClose ( Point point1, Point point2 ) : bool

Compares two points for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon

AreClose ( Rect rect1, Rect rect2 ) : bool

Compares two rectangles for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon

AreClose ( Size size1, Size size2 ) : bool

Compares two Size instances for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon

AreClose ( System vector1, System vector2 ) : bool

Compares two Vector instances for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon

AreClose ( double value1, double value2 ) : bool

AreClose - Returns whether or not two doubles are "close". That is, whether or not they are within epsilon of each other. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.

DoubleToInt ( double val ) : int

GreaterThan ( double value1, double value2 ) : bool

GreaterThan - Returns whether or not the first double is greater than the second double. That is, whether or not the first is strictly greater than *and* not within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.

GreaterThanOrClose ( double value1, double value2 ) : bool

GreaterThanOrClose - Returns whether or not the first double is greater than or close to the second double. That is, whether or not the first is strictly greater than or within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.

IsBetweenZeroAndOne ( double val ) : bool

IsNaN ( double value ) : bool
IsOne ( double value ) : bool

IsOne - Returns whether or not the double is "close" to 1. Same as AreClose(double, 1), but this is faster.

IsZero ( double value ) : bool

IsZero - Returns whether or not the double is "close" to 0. Same as AreClose(double, 0), but this is faster.

LessThan ( double value1, double value2 ) : bool

LessThan - Returns whether or not the first double is less than the second double. That is, whether or not the first is strictly less than *and* not within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.

LessThanOrClose ( double value1, double value2 ) : bool

LessThanOrClose - Returns whether or not the first double is less than or close to the second double. That is, whether or not the first is strictly less than or within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.

RectHasNaN ( Rect r ) : bool

rectHasNaN - this returns true if this rect has X, Y , Height or Width as NaN.

메소드 상세

AreClose() 공개 정적인 메소드

Compares two points for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon
public static AreClose ( Point point1, Point point2 ) : bool
point1 Point The first point to compare
point2 Point The second point to compare
리턴 bool

AreClose() 공개 정적인 메소드

Compares two rectangles for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon
public static AreClose ( Rect rect1, Rect rect2 ) : bool
rect1 System.Windows.Rect The first rectangle to compare
rect2 System.Windows.Rect The second rectangle to compare
리턴 bool

AreClose() 공개 정적인 메소드

Compares two Size instances for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon
public static AreClose ( Size size1, Size size2 ) : bool
size1 System.Windows.Size The first size to compare
size2 System.Windows.Size The second size to compare
리턴 bool

AreClose() 공개 정적인 메소드

Compares two Vector instances for fuzzy equality. This function helps compensate for the fact that double values can acquire error when operated upon
public static AreClose ( System vector1, System vector2 ) : bool
vector1 System The first Vector to compare
vector2 System The second Vector to compare
리턴 bool

AreClose() 공개 정적인 메소드

AreClose - Returns whether or not two doubles are "close". That is, whether or not they are within epsilon of each other. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.
public static AreClose ( double value1, double value2 ) : bool
value1 double The first double to compare.
value2 double The second double to compare.
리턴 bool

DoubleToInt() 공개 정적인 메소드

public static DoubleToInt ( double val ) : int
val double
리턴 int

GreaterThan() 공개 정적인 메소드

GreaterThan - Returns whether or not the first double is greater than the second double. That is, whether or not the first is strictly greater than *and* not within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.
public static GreaterThan ( double value1, double value2 ) : bool
value1 double The first double to compare.
value2 double The second double to compare.
리턴 bool

GreaterThanOrClose() 공개 정적인 메소드

GreaterThanOrClose - Returns whether or not the first double is greater than or close to the second double. That is, whether or not the first is strictly greater than or within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.
public static GreaterThanOrClose ( double value1, double value2 ) : bool
value1 double The first double to compare.
value2 double The second double to compare.
리턴 bool

IsBetweenZeroAndOne() 공개 정적인 메소드

public static IsBetweenZeroAndOne ( double val ) : bool
val double
리턴 bool

IsNaN() 공개 정적인 메소드

public static IsNaN ( double value ) : bool
value double
리턴 bool

IsOne() 공개 정적인 메소드

IsOne - Returns whether or not the double is "close" to 1. Same as AreClose(double, 1), but this is faster.
public static IsOne ( double value ) : bool
value double The double to compare to 1.
리턴 bool

IsZero() 공개 정적인 메소드

IsZero - Returns whether or not the double is "close" to 0. Same as AreClose(double, 0), but this is faster.
public static IsZero ( double value ) : bool
value double The double to compare to 0.
리턴 bool

LessThan() 공개 정적인 메소드

LessThan - Returns whether or not the first double is less than the second double. That is, whether or not the first is strictly less than *and* not within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.
public static LessThan ( double value1, double value2 ) : bool
value1 double The first double to compare.
value2 double The second double to compare.
리턴 bool

LessThanOrClose() 공개 정적인 메소드

LessThanOrClose - Returns whether or not the first double is less than or close to the second double. That is, whether or not the first is strictly less than or within epsilon of the other number. Note that this epsilon is proportional to the numbers themselves to that AreClose survives scalar multiplication. Note, There are plenty of ways for this to return false even for numbers which are theoretically identical, so no code calling this should fail to work if this returns false. This is important enough to repeat: NB: NO CODE CALLING THIS FUNCTION SHOULD DEPEND ON ACCURATE RESULTS - this should be used for optimizations *only*.
public static LessThanOrClose ( double value1, double value2 ) : bool
value1 double The first double to compare.
value2 double The second double to compare.
리턴 bool

RectHasNaN() 공개 정적인 메소드

rectHasNaN - this returns true if this rect has X, Y , Height or Width as NaN.
public static RectHasNaN ( Rect r ) : bool
r System.Windows.Rect The rectangle to test
리턴 bool