Previous Page Next Page Contents

=, <> -- equations and inequalities

Introduction

x = y defines an equation.

x <> y defines an inequality.

Call(s)


x = y _equal(x, y)

x <> y _unequal(x, y)

Parameters

x, y - arbitrary MuPAD objects

Returns

an expression of type "_equal" or "_unequal", respectively.

Related Functions

<, <=, >, >=, and, bool, FALSE, if, lhs, not, or, repeat, rhs, solve, TRUE, while, UNKNOWN

Details

Example 1

In the following, note the difference between syntactical and numerical equality. The numbers 1.5 and 3/2 coincide numerically. However, 1.5 is of domain type DOM_FLOAT, whereas 3/2 is of domain type DOM_RAT. Consequently, they are not regarded as equal in the following syntactical test:

>> 1.5 = 3/2; bool(%)
                                 1.5 = 3/2
      
                                   FALSE             

The following expressions coincide syntactically:

>> _equal(1/x, diff(ln(x),x)); bool(%)
                                   1   1
                                   - = -
                                   x   x
      
                                   TRUE            

The Boolean operator not converts equalities and inequalities:

>> not a = b, not a <> b
                               a <> b, a = b

Example 2

The examples below demonstrate how = and <> deal with non-mathematical objects and data structures:

>> if "text" = "t"."e"."x"."t" then "yes" else "no" end
                                   "yes"
>> bool(table(a = PI) <> table(a = E))
                                   TRUE

Example 3

We demonstrate the difference between the syntactical test via bool and the semantical test via is:

>> bool(1 = x/(x + y) + y/(x + y)), is(1 = x/(x + y) + y/(x + y))
                                FALSE, TRUE

Example 4

Equations and inequalities are typical input objects for system functions such as solve:

>> solve(x^2 - 2*x = -1, x)
                                    {1}
>> solve(x^2 - 2*x <> -1, x)
                               C_ minus {1}

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000