### The Maxima on-line user's manual

Algebra Calculator

#### Compare

Function: compare (<x>, <y>) Return a comparison operator <op> (`<`, `<=`, `>`, `>=`, `=`, or `#`) such that `is (<x> <op> <y>)` evaluates to `true`; when either <x> or <y> depends on `%i` and `<x> # <y>`, return `notcomparable`; when there is no such operator or Maxima isnt able to determine the operator, return `unknown`.

Examples:

```          (%i1) compare (1, 2);
(%o1)                           <
(%i2) compare (1, x);
(%o2)                        unknown
(%i3) compare (%i, %i);
(%o3)                           =
(%i4) compare (%i, %i + 1);
(%o4)                     notcomparable
(%i5) compare (1/x, 0);
(%o5)                           #
(%i6) compare (x, abs(x));
(%o6)                          <=```

The function `compare` doesnt try to determine whether the real domains of its arguments are nonempty; thus

```          (%i1) compare (acos (x^2 + 1), acos (x^2 + 1) + 1);
(%o1)                           <```

The real domain of `acos (x^2 + 1)` is empty.

```(%o1)                                true
(%i2) ```

### Related Examples

##### compare-cos-diff-phi-ratsimp-sin

v_r:(1-(3/2)*(R/r)+(1...

v_th:(-1+(3/4)*(R/r)+...

P:pr-(h*g*z)-(3/2)*m*...

Calculate

compare(1,1);

Calculate

##### compare-kill

kill(x);

compare(%e^%pi, %pi^%e);

compare(x^2+1,2*x);

Calculate

##### compare-cos-diff-phi-sin

v_r:(1-(3/2)*(R/r)+(1...

v_th:(-1+(3/4)*(R/r)+...

P:pr-(h*g*z)-(3/2)*m*...

Calculate

? compare;

Calculate

##### compare

compare( [1, 2, 3], [...

Calculate

##### compare-cos-diff-phi-sin

v_r:(1-(3/2)*(R/r)+(1...

v_th:(-1+(3/4)*(R/r)+...

P:pr-(h*g*z)-(3/2)*m*...

Calculate

##### compare-cos-diff-phi-sin

v_r:(1-(3/2)*(R/r)+(1...

v_th:(-1+(3/4)*(R/r)+...

P:pr-(h*g*z)-(3/2)*m*...

Calculate

##### compare-cos-diff-sin

v_r:(1-(3/2)*(R/r)+(1...

v_th:(-1+(3/4)*(R/r)+...

P:pr-(h*g*z)-(3/2)*m*...

Calculate

##### compare-cos-diff-phi-sin

v_r:(1-(3/2)*(R/r)+(1...

v_th:(-1+(3/4)*(R/r)+...

P:pr-(h*g*z)-(3/2)*m*...

Calculate