Example Complex - 002

 

 

Description

The difference of a variety of data types and a complex number is shown here. The result of the operation is shown in the comment. The first double shown is the real part of the result. The second number shown is the imaginary part of the result.

 

Details

The first Complex Number is defined.

(setq X (new Complex: 1.0 2.0)) Returns: #<Complex 123456>

The second Complex Number is defined.

(setq Y (new Complex: 2.0 1.0)) Returns: #<Complex 234567>

The result when 2 Complex Numbers are subtracted.

(- X Y) Returns: #c-1.0+1.0i

The result when a Complex Number is subtracted with a Void data type.

(- X #void ) Returns: #c1.0+2.0i

The result when a Complex Number is subtracted with a Number data type.

(- X 2 ) Returns: #c-1.0+2.0i

The result when a Complex Number is subtracted with a Real Number data type.

(- X 2.0 ) Returns: #c-1.0+2.0i

The result when a Complex Number is subtracted with a Character data type.

(- X #\A ) Returns: #c-64.0+2.0i

The result when a Complex Number is subtracted with a Boolean data type.

(- X true) Returns: #c2.0i

The result when a Complex Number is subtracted with a Date data type. Dates are stored as the number of days lapsed since day 0.

(- X #Jan,1,2000) Returns: #c-730483.0+2.0i

The result when a Complex Number is subtracted with a Money data type.

(- X $-.25) Returns: #c1.25+2.0i

The result when a Complex Number is subtracted with a Fraction numeric data type.

(- X -.25) Returns: #c1.25+2.0i

Notes and Hints

Immediate numeric types are converted to a pure real part with a zero imaginary part prior to forming the difference.

 

Related Examples

Here are examples of the - function at work.

Complex - 002 Complex - 003 Complex / 003 Number - 001

 

Function Links

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

-

Here are a number of links to other related functions.

*(#void) +(#void) /(#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