Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica >

Unequal (NotEqual, ≠)

lhsNotEqualrhs or lhsrhs
returns False if lhs and rhs are identical.
  • lhsrhs returns True if lhs and rhs are determined to be unequal by comparisons between numbers or other raw data, such as strings.
  • Approximate numbers are considered unequal if they differ beyond their last two decimal digits.
  • e_1!=e_2!=e_3!=... gives True only if none of the ei are equal. 2≠3≠2LongRightArrowFalse.
  • lhsrhs represents a symbolic condition that can be generated and manipulated by functions like Reduce and LogicalExpand.
  • For exact numeric quantities, Unequal internally uses numerical approximations to establish inequality. This process can be affected by the setting of the global variable $MaxExtraPrecision.
Returns True if elements are guaranteed unequal, and otherwise stays unevaluated:
Enter as NotEqual or as Esc NotEqual Esc:
Returns True if elements are guaranteed unequal, and otherwise stays unevaluated:
In[1]:=
Click for copyable input
Out[1]=
 
Enter as NotEqual or as Esc NotEqual Esc:
In[1]:=
Click for copyable input
Out[1]=
Test unequality of numbers:
Approximate numbers that differ in at most their last eight binary digits are considered equal:
Compare an exact numeric expression and an approximate number:
Compare two exact numeric expressions; a numeric test may suffice to prove unequality:
Proving equality requires symbolic methods:
Symbolic methods used by Unequal are insufficient to prove this False:
Use RootReduce to decide whether two algebraic numbers are unequal:
Numeric methods used by Unequal do not use sufficient precision to prove this unequality:
RootReduce proves that the two algebraic numbers are not equal:
Increasing $MaxExtraPrecision may also prove unequality:
This symbolic unequality is always False:
Unequal does not automatically prove this unequality:
Use Expand to prove it:
Compare more than two expressions:
Compare lists:
Compare strings:
The negation of two-argument Unequal is Equal:
The negation of three-argument Unequal does not simplify automatically:
Use LogicalExpand to express it in terms of two-argument Equal:
The negation of three-argument Unequal is not equivalent to three-argument Equal:
Unequal tests mathematical unequality of objects represented by expressions:
UnsameQ tests syntactic unequality of expressions:
When Unequal cannot decide whether two numeric expressions are equal it returns unchanged:
FullSimplify uses exact symbolic transformations to disprove the unequality:
PossibleZeroQ uses numeric and symbolic heuristics to decide whether an expression is zero:
Numeric methods used by PossibleZeroQ may incorrectly decide that a number is zero:
Unequality for machine-precision approximate numbers can be subtle:
The extra digits disrupt equality:
Arbitrary-precision approximate numbers do not have this problem:
Thanks to automatic-precision tracking Unequal knows to look only at the first ten digits:
In this case, the unequality test for machine numbers gives the expected result:
The extra digits in this case are ignored by Unequal:
New in 1 | Last modified in 3
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team