|
compare
|
Comparison of complex values is supported. The compare function returns
0 if two arguments have the same real and imaginary parts. If the first real
value {cpx 1} is less than the the second real value {cpx2}, or,
if the real parts are equal and the first imaginary value is less than the
second imaginary value, then -1 is returned. Similarly, if the first real value
of {cpx1} is greater than the real value of {cpx2}, or, if the real parts
are equal and the first imaginary part is greater than the second, then +1 is
returned.
Use the compare function when you wish to compare two arguments of the same Data Type and the result value needs to be represented as a numeric (0, 1 or -1). If a Boolean result is desired, then the Comparison Functions (=, <>, <, <=, >, >=) or the compareEQ, compareNE, compareGT, compareGE, compareLT, compareLE should be used instead.
Returns 0 if the two objects are equal. Returns -1 if the obj1 is less than obj2.
Returns +1 if obj1 is greater than obj2.
Here are a number of links to Lambda coding examples which contain this instruction in various use cases.
Here are the links to the data types of the function arguments. Here are also a number of links to functions having arguments with any of these data types.
You can always talk with the AIS at aiserver.sourceforge.net.
Name
Description
AIS Types obj1 The first object to be compared. Must be a native data type (or complex). Void Boolean Character Number Date Complex obj2 The second object to be compared. Must be a native data type (or complex). Void Boolean Character Number Date Complex
Returns:
Examples
Argument Types
How do I contact the AIS team?