Files
2025-10-25 03:02:53 +03:00

2.1 KiB

[complex.numbers.general]

29 Numerics library [numerics]

29.4 Complex numbers [complex.numbers]

29.4.1 General [complex.numbers.general]

1

#

The header defines a class template, and numerous functions for representing and manipulating complex numbers.

2

#

The effect of instantiating the primary template of complex for any type that is not a cv-unqualified floating-point type ([basic.fundamental]) is unspecified.

Specializations of complex for cv-unqualified floating-point types are trivially copyable literal types ([basic.types.general]).

3

#

If the result of a function is not mathematically defined or not in the range of representable values for its type, the behavior is undefined.

4

#

If z is an lvalue of type cv complex then:

the expression reinterpret_cast<cv T(&)[2]>(z) is well-formed,

reinterpret_cast<cv T(&)[2]>(z)[0] designates the real part of z, and

reinterpret_cast<cv T(&)[2]>(z)[1] designates the imaginary part of z.

Moreover, if a is an expression of type cv complex* and the expression a[i] is well-defined for an integer expression i, then:

reinterpret_cast<cv T*>(a)[2 * i] designates the real part of a[i], and

reinterpret_cast<cv T*>(a)[2 * i + 1] designates the imaginary part of a[i].