< | Test whether lhs is smaller than rhs |
> | Test whether lhs is larger than rhs |
<= | Test whether lhs is smaller or equal rhs |
>= | Test whether lhs is larger or equal rhs |
!= | Test whether two expressions are not equal |
= | Test whether two expressoins are equal |
Not | Logical negation |
And | Logical conjunction |
Or | Logical disjunction |
IsFreeOf | Test whether expression depends on variable |
IsZeroVector | Test whether list contains only zeroes |
IsNonObject | Test whether argument is not an Object() |
IsEven | Test whether integer is even |
IsOdd | Test whether integer is odd |
IsFunction | Test whether argument is a composite object |
IsAtom | Test whether argument is an atom |
IsString | Test whether argument is an string |
IsNumber | Test whether argument is a number |
IsList | Test whether argument is a list |
IsBound | Test whether a variable is bound to a value |
IsBoolean | Test whether argument is a Boolean |
IsNegativeNumber | Test whether argument is a negative number |
IsNegativeInteger | Test whether argument is a negative integer |
IsPositiveNumber | Test whether argument is a positive number |
IsPositiveInteger | Test whether argument is a positive integer |
IsNotZero | Test whether argument is a nonzero number |
IsNonZeroInteger | Test whether argument is a nonzero integer |
IsInfinity | Test whether argument is an infinity |
IsPositiveReal | Test whether argument is numerically positive |
IsNegativeReal | Test whether argument is numerically negative |
IsConstant | Test whether argument is constant |
The word "numeric" in the previous paragraph has the following meaning. An expression is numeric if it is either a number (i.e. IsNumber returns True), or the quotient of two numbers, or an infinity (i.e. IsInfinity returns True).
In> 2 < 5; Out> True; In> Cos(1) < 5; Out> Cos(1)<5; In> N(Cos(1)) < 5; Out> True |
The word "numeric" in the previous paragraph has the following meaning. An expression is numeric if it is either a number (i.e. IsNumber returns True), or the quotient of two numbers, or an infinity (i.e. IsInfinity returns True).
In> 2 > 5; Out> False; In> Cos(1) > 5; Out> Cos(1)>5; In> N(Cos(1)) > 5; Out> False |
The word "numeric" in the previous paragraph has the following meaning. An expression is numeric if it is either a number (i.e. IsNumber returns True), or the quotient of two numbers, or an infinity (i.e. IsInfinity returns True).
In> 2 <= 5; Out> True; In> Cos(1) <= 5; Out> Cos(1)<=5; In> N(Cos(1)) <= 5; Out> True |
The word "numeric" in the previous paragraph has the following meaning. An expression is numeric if it is either a number (i.e. IsNumber returns True), or the quotient of two numbers, or an infinity (i.e. IsInfinity returns True).
In> 2 >= 5; Out> False; In> Cos(1) >= 5; Out> Cos(1)>=5; In> N(Cos(1)) >= 5; Out> False |
The expression e1 != e2 is equivalent to Not(e1 = e2).
In> 1 != 2; Out> True; In> 1 != 1; Out> False; |
Note that the test is on syntactic equality, not mathematical equality. Hence even if the result is False, the expressions can still be (mathematically) equal; see the examples underneath. Put otherwise, this function tests whether the two expressions would be displayed in the same way if they were printed.
In> e1 := (x+1) * (x-1); Out> (x+1)*(x-1); In> e2 := x^2 - 1; Out> x^2-1; In> e1 = e2; Out> False; In> Expand(e1) = e2; Out> True; |
In> Not True Out> False; In> Not False Out> True; In> Not(a) Out> Not a; |
In> True And False Out> False; In> And(True,True) Out> True; In> False And a Out> False; In> True And a Out> And(a); In> And(True,a,True,b) Out> b And a; |
In> True Or False Out> True; In> False Or a Out> Or(a); In> Or(False,a,b,True) Out> True; |
The second form test whether the expression depends on any of the variables named in the list. The result is True if none of the variables appear in the expression and False otherwise.
In> IsFreeOf(Sin(x), x); Out> False; In> IsFreeOf(Sin(x), y); Out> True; In> IsFreeOf(D(x) a*x+b, x); Out> True; In> IsFreeOf(Sin(x), {x,y}); Out> False; |
In> IsZeroVector({0, x, 0}); Out> False; In> IsZeroVector({x-x, 1 - D(x) x}); Out> True; |
In> IsEven(4); Out> True; In> IsEven(-1); Out> False; |
In> IsOdd(4); Out> False; In> IsOdd(-1); Out> True; |
In> IsFunction(x+5); Out> True; In> IsFunction(x); Out> False; |
In> IsAtom(x+5); Out> Falso; In> IsAtom(5); Out> True; |
In> IsString("duh"); Out> True; In> IsString(duh); Out> False; |
In> IsNumber(6); Out> True; In> IsNumber(3.25); Out> True; In> IsNumber(I); Out> False; In> IsNumber("duh"); Out> False; |
In> IsList({2,3,5}); Out> True; In> IsList(2+3+5); Out> False; |
In> IsBound(x); Out> False; In> x := 5; Out> 5; In> IsBound(x); Out> True; |
In> IsBoolean(a) Out> False; In> IsBoolean(True) Out> True; In> IsBoolean(a And b) Out> True; |
In> IsNegativeNumber(6); Out> False; In> IsNegativeNumber(-2.5); Out> True; |
In> IsNegativeInteger(31); Out> False; In> IsNegativeInteger(-2); Out> True; |
In> IsPositiveNumber(6); Out> True; In> IsPositiveNumber(-2.5); Out> False; |
In> IsPositiveInteger(31); Out> True; In> IsPositiveInteger(-2); Out> False; |
In> IsNotZero(3.25); Out> True; In> IsNotZero(0); Out> False; |
In> IsNonZeroInteger(0) Out> False; In> IsNonZeroInteger(-2) Out> True; |
In> IsInfinity(10^1000); Out> False; In> IsInfinity(-Infinity); Out> True; |
In> IsPositiveReal(Sin(1)-3/4); Out> True; In> IsPositiveReal(Sin(1)-6/7); Out> False; In> IsPositiveReal(Exp(x)); Out> False; |
In> IsNegativeReal(Sin(1)-3/4); Out> False; In> IsNegativeReal(Sin(1)-6/7); Out> True; In> IsNegativeReal(Exp(x)); Out> False; |
In> IsConstant(Cos(x)) Out> False; In> IsConstant(Cos(2)) Out> True; In> IsConstant(Cos(2+x)) Out> False; |