This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

20
cppdraft/complex.md Normal file
View File

@@ -0,0 +1,20 @@
[complex]
# 29 Numerics library [[numerics]](./#numerics)
## 29.4 Complex numbers [[complex.numbers]](complex.numbers#complex)
### 29.4.3 Class template complex [complex]
[🔗](#lib:complex)
namespace std {template<class T> class complex {public:using value_type = T; constexpr complex(const T& re = T(), const T& im = T()); constexpr complex(const complex&) = default; template<class X> constexpr explicit(*see below*) complex(const complex<X>&); 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<class X> constexpr complex& operator= (const complex<X>&); template<class X> constexpr complex& operator+=(const complex<X>&); template<class X> constexpr complex& operator-=(const complex<X>&); template<class X> constexpr complex& operator*=(const complex<X>&); template<class X> constexpr complex& operator/=(const complex<X>&); };}
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L347)
The classcomplex describes an object that can
store the Cartesian components,real() andimag(),
of a complex
number[.](#1.sentence-1)