Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • Compute Services
  • System Modeler
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

Wolfram Consulting

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Notebook Assistant + LLM Kit
    • Compute Services
    • System Modeler
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
Unequal
  • See Also
    • Equal
    • UnsameQ
    • Order
    • DisjointQ
    • BinaryDistance
  • Related Guides
    • Inequalities
    • Testing Expressions
    • Language Overview
    • Wolfram Language Syntax
    • Conditionals
    • Logic & Boolean Algebra
    • Symbolic Vectors, Matrices and Arrays
  • Tech Notes
    • Relational and Logical Operators
    • See Also
      • Equal
      • UnsameQ
      • Order
      • DisjointQ
      • BinaryDistance
    • Related Guides
      • Inequalities
      • Testing Expressions
      • Language Overview
      • Wolfram Language Syntax
      • Conditionals
      • Logic & Boolean Algebra
      • Symbolic Vectors, Matrices and Arrays
    • Tech Notes
      • Relational and Logical Operators

lhs!=rhs or lhs≠rhs

returns False if lhs and rhs are identical.

Details
Details and Options Details and Options
Background & Context
Examples  
Basic Examples  
Scope  
Numeric Inequations  
Symbolic Inequations  
Properties & Relations  
Possible Issues  
See Also
Tech Notes
Related Guides
Related Links
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • Equal
    • UnsameQ
    • Order
    • DisjointQ
    • BinaryDistance
  • Related Guides
    • Inequalities
    • Testing Expressions
    • Language Overview
    • Wolfram Language Syntax
    • Conditionals
    • Logic & Boolean Algebra
    • Symbolic Vectors, Matrices and Arrays
  • Tech Notes
    • Relational and Logical Operators
    • See Also
      • Equal
      • UnsameQ
      • Order
      • DisjointQ
      • BinaryDistance
    • Related Guides
      • Inequalities
      • Testing Expressions
      • Language Overview
      • Wolfram Language Syntax
      • Conditionals
      • Logic & Boolean Algebra
      • Symbolic Vectors, Matrices and Arrays
    • Tech Notes
      • Relational and Logical Operators

Unequal

lhs!=rhs or lhs≠rhs

returns False if lhs and rhs are identical.

Details

  • can be entered as x∖[NotEqual]y or x != y.
  • lhs≠rhs 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.
  • gives True only if none of the ei are equal. 2≠3≠2->False.
  • lhs≠rhs represents a symbolic condition that can be generated and manipulated by functions like Reduce and LogicalExpand.
  • Unequal[e] gives True.
  • 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.
  • In StandardForm, Unequal is printed using ≠.

Background & Context

  • Unequal[expr1,expr2] returns True if expr1 and expr2 are numerically unequal, False if they are equal and unevaluated if equality cannot be established. For example, Unequal[(1+Sqrt[5])/2,GoldenRatio] returns False, Unequal[1,2] returns True, and Unequal[1,a] returns unevaluated. Unequal[expr1,expr2] may be input as expr1!=expr2 or using the \[NotEqual] character as expr1≠expr2. The multiple-argument form Unequal[expr1,expr2,…], which may also be input as expr1!=expr2!=…, returns True if none of the expressions expri are numerically equal, False if any two are equal and unevaluated otherwise. The single-argument form Unequal[expr] returns True (as, slightly paradoxically, does the single-argument form Equal[expr]).
  • Numbers with machine precision (MachinePrecision) or greater are considered equal if they differ in at most their last seven binary digits and unequal otherwise. Equality for numbers below machine precision is established based on agreement to within the precision of the lowest precision number. For example, 1.01`2!=1 returns False, while 1.01`3==1 returns True. For exact numeric quantities, Unequal uses numerical approximations to establish inequality, which can be affected by the value of the global variable $MaxExtraPrecision.
  • Unequal is related to a number of other symbols. UnsameQ[expr1,expr2] (which may be input as expr1=!=expr2) returns True if expr1 and expr2 differ in their underlying FullForm representations and otherwise returns False. In contrast to Unequal, UnsameQ differentiates between different representations of numbers; for example, UnsameQ[1,1.] and UnsameQ[1.,1.+0.I] both return True. The behavior of UnsameQ also differs from that of Unequal in that UnsameQ always evaluates to True or False, whereas Unequal may remain unevaluated in cases where equality cannot be resolved. Equal (which may be input as expr1==expr2) is the converse of Unequal. Unequal also has an operator form UnequalTo.
  • PossibleZeroQ can be used to indicate if a given expression has value in some cases where Unequal returns unevaluated. For example, Unequal[Erf[Log[4]+2Log[Sin[Pi/8]]]-Erf[Log[2-Sqrt[2]]],0] returns evaluated, while calling PossibleZeroQ on its first argument returns True (together with an informative message indicating that a zero value could not be rigorously established). Symbolic simplifiers like Simplify, FullSimplify and RootReduce can sometimes also be used to rigorously establish equality (including in the example just given) when Unequal cannot.

Examples

open all close all

Basic Examples  (2)

Returns True if elements are guaranteed unequal, and otherwise stays unevaluated:

Enter as != or as !=:

Scope  (11)

Numeric Inequations  (6)

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:

Symbolic Inequations  (5)

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:

Properties & Relations  (4)

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:

Possible Issues  (3)

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 10 digits:

In this case, the unequality test for machine numbers gives the expected result:

The extra digits in this case are ignored by Unequal:

See Also

Equal  UnsameQ  Order  DisjointQ  BinaryDistance

Tech Notes

    ▪
  • Relational and Logical Operators

Related Guides

    ▪
  • Inequalities
  • ▪
  • Testing Expressions
  • ▪
  • Language Overview
  • ▪
  • Wolfram Language Syntax
  • ▪
  • Conditionals
  • ▪
  • Logic & Boolean Algebra
  • ▪
  • Symbolic Vectors, Matrices and Arrays

Related Links

  • An Elementary Introduction to the Wolfram Language : Tests and Conditionals

History

Introduced in 1988 (1.0) | Updated in 1996 (3.0)

Wolfram Research (1988), Unequal, Wolfram Language function, https://reference.wolfram.com/language/ref/Unequal.html (updated 1996).

Text

Wolfram Research (1988), Unequal, Wolfram Language function, https://reference.wolfram.com/language/ref/Unequal.html (updated 1996).

CMS

Wolfram Language. 1988. "Unequal." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/Unequal.html.

APA

Wolfram Language. (1988). Unequal. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Unequal.html

BibTeX

@misc{reference.wolfram_2025_unequal, author="Wolfram Research", title="{Unequal}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/Unequal.html}", note=[Accessed: 04-February-2026]}

BibLaTeX

@online{reference.wolfram_2025_unequal, organization={Wolfram Research}, title={Unequal}, year={1996}, url={https://reference.wolfram.com/language/ref/Unequal.html}, note=[Accessed: 04-February-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English