Example Complex + 001

 

 

Description

The sum of a variety of data types with 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 #c1.0+2.0i) Returns: #<Complex 123456>

The second Complex Number is defined.

(setq Y #c2.0+1.0i) Returns: #<Complex 234567>

The result when 2 Complex Numbers are added.

(+ X Y) Returns: #c3.0+3.0i

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

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

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

(+ X 2 ) Returns: #c3.0+2.0i

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

(+ X 2.0 ) Returns: #c3.0+2.0i

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

(+ X #\A ) Returns: #c66.0+2.0i

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

(+ X true) Returns: #c2.0+2.0i

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

(+ X #Jan,1,2000) Returns: #c730485.0+2.0i

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

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

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

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

Notes and Hints

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

 

Related Examples

Here are examples of the + function at work.

Complex + 001 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