Comparison Operators

Comparison Operators — (!=, <, <=, ==, >, >=, )

Syntax

number != number
number &lt; number
number &lt;= number
number == number
number &gt; number
number &gt;= number

		

Arguments

number

Any integer or real number. Non-numbers are treated as zero.

Returns

!=   t if the first number is not equal to the second, else nil.

<   t if the first number is less than the second, else nil.

<=   t if the first number is less than or equal to the second, else nil.

==   t if the first number Is equal to the second, else nil.

>   t if the first number is greater than the second, else nil.

>=   t if the first number is greater than or equal to the second, else nil.

Description

These functions perform a numeric comparison of their arguments. In mathematical (infix) notation, the function would put the first argument on the left side of the comparison, and the second argument on the right side of the comparison.

Example

Gamma> 5 < 6;
t
Gamma> 5 > 6;
nil
Gamma> 5.00 == 5;
t
Gamma> "hello" == string("hel","lo");
t
Gamma> a = 5 + 1;
6
Gamma> a;
6
Gamma> a == 5;
nil
Gamma> 
		

See Also

eq, equal, strcmp, stricmp