 complex - Maple Help

type/complex

check for an object of type complex

type/complex

check for an object of type complex Calling Sequence type(x, complex) type(x, complex(d)) type(x, complex) Parameters

 x - any expression d - any type Description

 • The type(x, complex) function returns true if x is an expression of the form $a+Ib$, where a (if present) and b (if present) are finite and of type realcons.
 • The type(x, complex(d)) function returns true if $±\Re \left(x\right)$ or (if present) and $±\Im \left(x\right)$ (if present) are both of type d.
 • The type(x, complex) function returns true if the real and imaginary parts of x are Maple hardware floats.
 The "8" in complex refers to the number of bytes allocated for the underlying hardware floating-point numbers.  As a complex number has two parts, real and imaginary, each complex requires 16 bytes.
 You can build complex expressions using the HFloat command. Examples

 > $\mathrm{type}\left(5I,\mathrm{complex}\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left(x,\mathrm{complex}\right)$
 ${\mathrm{false}}$ (2)

Test whether the real and imaginary parts are rational numbers.

 > $\mathrm{type}\left(\frac{1}{2}+3I,\mathrm{complex}\left(\mathrm{rational}\right)\right)$
 ${\mathrm{true}}$ (3)

Test whether the real and imaginary parts are names.

 > $\mathrm{type}\left(a-Ib,\mathrm{complex}\left(\mathrm{name}\right)\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{type}\left(2+Ib,\mathrm{complex}\left(\mathrm{name}\right)\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{type}\left(2+\frac{4}{7}I,\mathrm{complex}\left(\mathrm{numeric}\right)\right)$
 ${\mathrm{true}}$ (6)

Build a complex number using software floats.

 > $\mathrm{cf}≔1.+2.I:$
 > $\mathrm{type}\left(\mathrm{cf},\mathrm{complex}\left(\mathrm{float}\right)\right)$
 ${\mathrm{true}}$ (7)
 > $\mathrm{type}\left(\mathrm{cf},\mathrm{complex}\left[8\right]\right)$
 ${\mathrm{false}}$ (8)

Build a complex number using hardware floats.

 > $\mathrm{chf}≔\mathrm{HFloat}\left(\mathrm{cf}\right)$
 ${\mathrm{chf}}{≔}{1.}{+}{2.}{}{I}$ (9)
 > $\mathrm{type}\left(\mathrm{chf},\mathrm{complex}\left(\mathrm{float}\right)\right)$
 ${\mathrm{true}}$ (10)
 > $\mathrm{type}\left(\mathrm{chf},\mathrm{complex}\left[8\right]\right)$
 ${\mathrm{true}}$ (11)