Complex floating-point type
A complex floating-point type represents complex numbers with real and imaginary components, using floating-point values for those components.
Modern C, Third Edition
A complex type is a C arithmetic type representing a complex number with real and imaginary components based on a corresponding real floating-point type.
- How it is used
- Classifies complex numbers as one of C’s four principal numeric classes and supports their construction and component access.
- How deep it goes
- Defines representation, construction, portability, and component access, but stops short of detailed complex arithmetic.
- Examples
- Uses CMPLX(0.5, 0.5), 0.5 + 0.5*I, creal, cimag, and the nonstandard 0.5i literal as concrete examples.
- What you can do after
- Constructs portable complex constants and extracts their real and imaginary components while recognizing platform and comparison constraints.
Read how Modern C, Third Edition explains complex floating-point type →
Modern C
A complex number is a number expressible as the sum of a real component and an imaginary component.
- How it is used
- Classifies floating-point values that carry real and imaginary components and provides syntax for constructing them.
- How deep it goes
- Defines the three complex precisions and demonstrates constant construction, but does not develop complex arithmetic functions.
- Examples
- Uses CMPLX, CMPLXF, CMPLXL, I, and expressions such as 0.5 + 0.5*I.
- What you can do after
- Apply it via C's complex.h macros to declare complex values and construct constants with selected precision.
The Quick Python Book, Fourth Edition
A complex number is a number consisting of a real component and an imaginary component, represented in Python with an imaginary component suffixed by j.
- How it is used
- Represents values with real and imaginary components and supports arithmetic or specialized numerical functions.
- How deep it goes
- Explains literal syntax, arithmetic, component attributes, object preservation, and cmath usage without formal mathematical treatment.
- Examples
- Demonstrates literals, multiplication, exponentiation, real and imaginary attributes, and cmath.sqrt(-1).
- What you can do after
- Apply complex arithmetic and inspect components, then call complex-capable functions through the cmath module.
Read how The Quick Python Book, Fourth Edition explains complex floating-point type →
Related concepts
- number typekind of · A number type is a programming-language or data-system type whose values represent numeric quantities and support defined numerical operations.
- arrayequivalent to · An array is an indexed, ordered collection of elements arranged in one or more dimensions, with elements accessed by position.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


