Example Complex comparison 021

 

 

Description

The result of the comparison operators on the jmple, jmplt jmpeq, jmpne, jmpge and jmpgt functions.

 

Details

On the jmple function:

(setq X #c65.0) (setq Y #c65.0+1.0i) (setq Z #c65.0-1.0i) (if (> Y X) true) (if (> Y 65.0) true) (if (> Y 65) true) (if (> Y #\A) true) (if (> 65.0 X) false true) (if (> 65 X) false true) (if (> #\A X) false true) Returns: true

On the jmplt function:

(if (>= Y X) true) (if (>= Y 65.0) true) (if (>= Y 65) true) (if (>= Y #\A) true) (if (>= 65.0 Y) false true) (if (>= 65 Y) false true) (if (>= #\A Y) false true) Returns: true

On the jmpeq function:

(if (<> Y X) true) (if (<> Y 65.0) true) (if (<> Y 65) true) (if (<> Y #\A) true) (if (<> 65.0 X) false true) (if (<> 65 X) false true) (if (<> #\A X) false true) Returns: true

On the jmpne function:

(if (= X X) true) (if (= X 65.0) true) (if (= X 65) true) (if (= X #\A) true) (if (= 65.0 Z) false true) (if (= 65 Z) false true) (if (= #\A Z) false true) Returns: true

On the jmpge function:

(if (< X Y) true) (if (< 65.0 Y) true) (if (< 65 Y) true) (if (< #\A Y) true) (if (< X 65.0) false true) (if (< X 65 ) false true) (if (< X #\A ) false true) Returns: true

On the jmpgt function:

(if (<= X Y) true) (if (<= 65.0 X) true) (if (<= 65 Y) true) (if (<= #\A Z) true) (if (<= Y 65.0) false true) (if (<= Y 65 ) false true) (if (<= Y #\A ) false true) Returns: true

Notes and Hints

The comparison operators are instrumental in implementing comparison tests as shown in the above examples.

Only if the real parts of the two arguments are equal, the imaginary parts are compared. If one argument has only a real part, the imaginary part is taken to be zero.

 

Related Examples

Here are examples of the comparison function at work.

BitVector compare 018 BitVector comparison 014 Boolean comparison functions 009 Brick comparison 019
Character comparison 010 Complex comparison 021 Date comparison functions 011 Dictionary compare 004
Dictionary comparison functions 004 Directory compare 005 Directory comparison functions 005 FltVector comparison functions 014
Function comparison functions 012 IntVector compare 015 IntVector comparison functions 014 List comparison 020
Matrix compare 007 Matrix comparison functions 007 NumMatrix compare 023 NumMatrix comparison functions 023
NumVector compare 016 NumVector comparison 014 Number comparison 010 ObjVector compare 017
ObjVector comparison functions 014 ObjectRepository comparison 021 ObjectRepository comparison 022 Pair comparison 019
ShortVector compare 016 ShortVector comparison functions 015 String comparison functions 001 Structure comparison functions 003
Symbol comparison functions 002 Vector compare 006 Vector comparison functions 006 Void comparison functions 008

 

Function Links

Here is the link to the current function used in this example.

comparison

Here are a number of links to other related functions.

compare(#void) compareEQ(#void) compareGT(#void) compareNE(#void)
compareLT(#void) compareLE(#void)

 

Argument Types

Here are the links to the data types of the arguments used in this example.

Complex

Here are a number of links to examples having similar argument types.

Complex + 001 Complex - 002 Complex - 003 Complex / 003
Complex abs 002 Complex append 011 Complex argument 001 Complex comparison 021
Complex conjugate 001 Complex imaginary 001 Complex isComplex 001 Complex log10 002
Complex log2 002 Complex logbase 002 Complex real 001 Complex sin 002
Complex string 004 Dictionary isDictionary 001 String isChar 001 String isCharAlphabetic 001
String isCharAlphanumeric 001 String isCharLowercase 001 String isCharName 001 String isCharNumeric 001
String isCharUppercase 001 String isCharWhitespace 001 String isEqual 001 String isEqual 002
String isObject 001 String isString 001 String isText 001 String isType 001
String isType 002 String isType 003 String parse 001 String sizeof 001
String string 001 String string 002 String string 003 String type 001
Symbol isCharName 002 Symbol isCharNumeric 002 Symbol isObject 002 Symbol isSymbol 001
Symbol isType 004 Symbol sizeof 002 Symbol type 002

Analytic Information Server (AIS)

AIS Component Systems

  • Smartbase Engine
  • QT C++ Libraries
  • MySQL Relational Database
  • AIS Lisp Libraries
  • Rapid Analytic Demo IDE