Point.Inequality(Point, Point) Operator

Definition

Point 구조체가 다른지 여부를 비교합니다.Compares two Point structures for inequality.

public:
 static bool operator !=(System::Windows::Point point1, System::Windows::Point point2);
public static bool operator != (System.Windows.Point point1, System.Windows.Point point2);
static member op_Inequality : System.Windows.Point * System.Windows.Point -> bool
Public Shared Operator != (point1 As Point, point2 As Point) As Boolean

Parameters

point1
Point

비교할 첫 번째 점입니다.The first point to compare.

point2
Point

비교할 두 번째 점입니다.The second point to compare.

Returns

Boolean

point1point2에 다른 X 또는 Y 좌표가 있으면 true이고, point1point2에 동일한 XY 좌표가 있이면 false입니다.true if point1 and point2 have different X or Y coordinates; false if point1 and point2 have the same X and Y coordinates.

Examples

다음 예제에서는 두 여부를 확인 하는 방법을 보여 줍니다 Point 구조체가 다른 오버 로드 된를 사용 하 여 (! =) 연산자.The following example shows how to check whether two Point structures are not equal, using the overloaded (!=) operator.

private Boolean overloadedInequalityOperatorExample()
{
    Point point1 = new Point(20, 30);
    Point point2 = new Point(45, 70);

    // Check whether the two Points are not equal, using the overloaded 
    // inequality operator.
    // areNotEqual is True.
    Boolean areNotEqual = (point1 != point2);

    return areNotEqual;
}
Private Function overloadedInequalityOperatorExample() As Boolean
    Dim point1 As New Point(20, 30)
    Dim point2 As New Point(45, 70)

    ' Check whether the two Points are not equal, using the overloaded 
    ' inequality operator.
    ' areNotEqual is True.
    Dim areNotEqual As Boolean = (point1 <> point2)

    Return areNotEqual

End Function

Remarks

점의 X 하 고 Y 좌표를 사용 하 여 나와 Double 값입니다.A point's X and Y coordinates are described using Double values. 때문에 Double 값에는 두 비교에 연산을 수행 하는 경우 전체 자릿수가 손실 될 수 있습니다 Point 논리적으로 동일한 값을 실패할 수 있습니다.Because Double values can lose precision when operated on, a comparison between two Point values that are logically equal might fail.

Applies to