Export (0) Print
Expand All

Matrix.Equals Method

Determines whether the two specified Matrix structures have the same values.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method Equals(Matrix) Determines whether the specified Matrix structure is identical to this instance.
Public method Equals(Object) Determines whether the specified Object is a Matrix structure that is identical to this Matrix. (Overrides ValueType.Equals(Object).)
Public method Static member Equals(Matrix, Matrix) Determines whether the two specified Matrix structures are identical.
Top

Note Note

A Matrix stores its values as doubles. Because the value of a Double can lose precision when arithmetic operations are performed on it, a comparison between two Double structures that are logically equal might fail.

The following example shows how to check two Matrix structures for equality.

private void equalityExample()
{

    Matrix matrix1 = new Matrix(5, 10, 15, 20, 25, 30);
    Matrix matrix2 = new Matrix(5, 10, 15, 20, 25, 30);

    Boolean result;

    // result is true.
    result = (matrix1 == matrix2);            

    // result is false.
    result = (matrix1 != matrix2);

}
Show:
© 2014 Microsoft