Node: Comparison on Numbers, Next: , Previous: Predicates on Numbers, Up: Numbers



Comparison on Numbers

Numbers can be compared with the following functions.

lessThan x y Function

greaterThan x y Function

lessThanOrEqual x y Function

greaterThanOrEqual x y Function

These functions take Lpp Number objects for arguments x and y and return non-nil if the comparison is true and nil otherwise. For each of these functions respectively non-nil is returned if x is less than y, x is greater than y, x is less than or equal to y, x is greater than or equal to y.

Note that the equality of Numbers can be checked using equal and more efficiently using eql See Equality Predicates.