cmp
Function 'cmp' compares two objects and returns an integer according to the outcome.
- If object1 < object2 then cmp(object1, object2) => -1
- If object1 == object2 then cmp(object1, object2) => 0
- If object1 > object2 then cmp(object1, object2) => 1
The function handles null arguments, a null argument is considered as the smallest value of all.
- If object1 is null and object2 is any not null value then cmp(object1, object2) => -1
- If object1 is null and object2 is null then cmp(object1, object2) => 0
- If object1 is any not null value and object2 is null then cmp(object1, object2) => 1
|