Files
cppdraft_translate/cppdraft/complex.md
2025-10-25 03:02:53 +03:00

1.4 KiB

[complex]

29 Numerics library [numerics]

29.4 Complex numbers [complex.numbers]

29.4.3 Class template complex [complex]

🔗

namespace std {template class complex {public:using value_type = T; constexpr complex(const T& re = T(), const T& im = T()); constexpr complex(const complex&) = default; template constexpr explicit(see below) complex(const complex&); constexpr T real() const; constexpr void real(T); constexpr T imag() const; constexpr void imag(T); constexpr complex& operator= (const T&); constexpr complex& operator+=(const T&); constexpr complex& operator-=(const T&); constexpr complex& operator*=(const T&); constexpr complex& operator/=(const T&); constexpr complex& operator=(const complex&); template constexpr complex& operator= (const complex&); template constexpr complex& operator+=(const complex&); template constexpr complex& operator-=(const complex&); template constexpr complex& operator*=(const complex&); template constexpr complex& operator/=(const complex&); };}

1

#

The classcomplex describes an object that can store the Cartesian components,real() andimag(), of a complex number.