complex - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


type/complex

check for an object of type complex

type/complex[8]

check for an object of type complex[8]

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

type(x, complex)

type(x, complex(d))

type(x, complex[8])

Parameters

x

-

any expression

d

-

any type

Description

• 

The type(x, complex) function returns true if x is an expression of the form a+I⁢b, where a (if present) and b (if present) are finite and of type realcons.

• 

The type(x, complex(d)) function returns true if ±ℜ⁡x or (if present) and ±ℑ⁡x (if present) are both of type d.

• 

The type(x, complex[8]) function returns true if the real and imaginary parts of x are Maple hardware floats.

  

The "8" in complex[8] refers to the number of bytes allocated for the underlying hardware floating-point numbers.  As a complex[8] number has two parts, real and imaginary, each complex[8] requires 16 bytes.

  

You can build complex[8] expressions using the HFloat command.

Examples

> 

type⁡5⁢I,complex

true

(1)
> 

type⁡x,complex

false

(2)

Test whether the real and imaginary parts are rational numbers.

> 

type⁡12+3⁢I,complex⁡rational

true

(3)

Test whether the real and imaginary parts are names.

> 

type⁡a−I⁢b,complex⁡name

true

(4)
> 

type⁡2+I⁢b,complex⁡name

false

(5)
> 

type⁡2+47⁢I,complex⁡numeric

true

(6)

Build a complex number using software floats.

> 

cf≔1.+2.⁢I:

> 

type⁡cf,complex⁡float

true

(7)
> 

type⁡cf,complex8

false

(8)

Build a complex number using hardware floats.

> 

chf≔HFloat⁡cf

chf≔1.+2.⁢I

(9)
> 

type⁡chf,complex⁡float

true

(10)
> 

type⁡chf,complex8

true

(11)

See Also

complex

evalc

Im

Re

type

type/complexcons

type/float

type/numeric

type/realcons