5.4 Comparisons of Ring Elements

r = s
r < s

The equality operator = evaluates to true if the two ring elements r and s are equal, and to false otherwise. The inequality operator < evaluates to true if the two ring elements r and s are not equal, and to false otherwise. Note that any two ring elements can be compared, even if they do not lie in compatible rings. In this case they can, of course, never be equal. For each type of rings the equality of those ring elements is given in the respective chapter.

Ring elements can also be compared with objects of other types. Of course they are never equal.

r < s
r <= s
r s
r = s

The operators <, <=, , and = evaluate to true if the ring element r is less than, less than or equal to, greater than, or greater than or equal to the ring element s, and to false otherwise. For each type of rings the definition of the ordering of those ring elements is given in the respective chapter. The ordering of ring elements is as follows. Rationals are smallest, next are cyclotomics, followed by finite ring elements.

Ring elements can also be compared with objects of other types. They are smaller than everything else.

Previous Up Top Next
Index

GAP 3.4.4
April 1997