(directly go to documentation on : <, >, <=, >=, IsZero, IsRational. )

3. Predicates relating to numbers

< test for "less than"
> test for "greater than"
<= test for "less or equal"
>= test for "greater or equal"
IsZero test whether argument is zero
IsRational test whether argument is a rational


< -- test for "less than"

Standard library
Calling format:
e1 < e2
Precedence: 90

Parameters:
e1, e2 -- expressions to be compared

Description:
The two expression are evaluated. If both results are numeric, they are compared. If the first expression is smaller than the second one, the result is True and it is False otherwise. If either of the expression is not numeric, after evaluation, the expression is returned with evaluated arguments.

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). Yacas will try to coerce the arguments passed to this comparison operator to a real value before making the comparison.

Examples:
In> 2 < 5;
Out> True;
In> Cos(1) < 5;
Out> True;

See also:
IsNumber , IsInfinity , N .


> -- test for "greater than"

Standard library
Calling format:
e1 > e2
Precedence: 90

Parameters:
e1, e2 -- expressions to be compared

Description:
The two expression are evaluated. If both results are numeric, they are compared. If the first expression is larger than the second one, the result is True and it is False otherwise. If either of the expression is not numeric, after evaluation, the expression is returned with evaluated arguments.

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). Yacas will try to coerce the arguments passed to this comparison operator to a real value before making the comparison.

Examples:
In> 2 > 5;
Out> False;
In> Cos(1) > 5;
Out> False

See also:
IsNumber , IsInfinity , N .


<= -- test for "less or equal"

Standard library
Calling format:
e1 <= e2
Precedence: 90

Parameters:
e1, e2 -- expressions to be compared

Description:
The two expression are evaluated. If both results are numeric, they are compared. If the first expression is smaller than or equals the second one, the result is True and it is False otherwise. If either of the expression is not numeric, after evaluation, the expression is returned with evaluated arguments.

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). Yacas will try to coerce the arguments passed to this comparison operator to a real value before making the comparison.

Examples:
In> 2 <= 5;
Out> True;
In> Cos(1) <= 5;
Out> True

See also:
IsNumber , IsInfinity , N .


>= -- test for "greater or equal"

Standard library
Calling format:
e1 >= e2
Precedence: 90

Parameters:
e1, e2 -- expressions to be compared

Description:
The two expression are evaluated. If both results are numeric, they are compared. If the first expression is larger than or equals the second one, the result is True and it is False otherwise. If either of the expression is not numeric, after evaluation, the expression is returned with evaluated arguments.

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). Yacas will try to coerce the arguments passed to this comparison operator to a real value before making the comparison.

Examples:
In> 2 >= 5;
Out> False;
In> Cos(1) >= 5;
Out> False

See also:
IsNumber , IsInfinity , N .


IsZero -- test whether argument is zero

Standard library
Calling format:
IsZero(n)

Parameters:
n -- number to test

Description:
IsZero(n) evaluates to True if "n" is zero. In case "n" is not a number, the function returns False.

Examples:
In> IsZero(3.25)
Out> False;
In> IsZero(0)
Out> True;
In> IsZero(x)
Out> False;

See also:
IsNumber , IsNotZero .


IsRational -- test whether argument is a rational

Standard library
Calling format:
IsRational(expr)

Parameters:
expr -- expression to test

Description:
This commands tests whether the expression "expr" is a rational number, i.e. an integer or a fraction of integers.

Examples:
In> IsRational(5)
Out> False;
In> IsRational(2/7)
Out> True;
In> IsRational(0.5)
Out> False;
In> IsRational(a/b)
Out> False;
In> IsRational(x + 1/x)
Out> False;

See also:
Numer , Denom .