[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/cpp/header/complex [Back]  [Original]

<complex> cppreference.com
cppreference.com

<complex>

cppreference.com
 
C++
(C++20)
(C++20)
(C++11)
(C++20)
/
(C++11)
(C++11)
(C++11)
(C++17)
 
<concepts> (C++20)
<system_error> (C++11)

<memory_resource> (C++17)  
<type_traits> (C++11)
<ratio> (C++11)
<utility>
<tuple> (C++11)
<optional> (C++17)
<variant> (C++17)
<any> (C++17)
<expected> (C++23)
<bitset>

<charconv> (C++17)
<format> (C++20)
<bit> (C++20)

<cuchar> (C++11)

<flat_set> (C++23)
<span> (C++20)
<mdspan> (C++23)

<iterator>
<ranges> (C++20)
<generator> (C++23)
<cfenv> (C++11)
<complex>
<numbers> (C++20)

<chrono> (C++11)
<codecvt> (C++11/17*)
/
<filesystem> (C++17)
<cstdio>
<cinttypes> (C++11)
<strstream> (C++98*)
<regex> (C++11)
<stop_token> (C++20)
<thread> (C++11)
<atomic> (C++11)
<stdatomic.h> (C++23)
<mutex> (C++11)
<shared_mutex> (C++14)
<condition_variable> (C++11)  
<semaphore> (C++20)
<latch> (C++20)
<barrier> (C++20)
<future> (C++11)

C
<cstdbool> (C++11/17/20*)  
<ccomplex> (C++11/17/20*)
<ctgmath> (C++11/17/20*)

<cstdalign> (C++11/17/20*)

<ciso646> ( C++20)

 

numeric .

a complex number type
( )
a complex number type
( )


( ) []

( ) []

( ) []

( ) []

( ) []

( ) []

( ) []

( ) []

( ) []

( ) []
(C++11)

( ) []

( ) []
e
( ) []
,
( ) []
,
( ) []
,
( ) []

( ) []
(\({\small\sin{z} }\)sin(z))
( ) []
(\({\small\cos{z} }\)cos(z))
( ) []
(\({\small\tan{z} }\)tan(z))
( ) []
(\({\small\arcsin{z} }\)arcsin(z))
( ) []
(\({\small\arccos{z} }\)arccos(z))
( ) []
(\({\small\arctan{z} }\)arctan(z))
( ) []
(\({\small\sinh{z} }\)sinh(z))
( ) []
(\({\small\cosh{z} }\)cosh(z))
( ) []
(\({\small\tanh{z} }\)tanh(z))
( ) []
(\({\small\operatorname{arsinh}{z} }\)arsinh(z))
( ) []
(\({\small\operatorname{arcosh}{z} }\)arcosh(z))
( ) []
(\({\small\operatorname{artanh}{z} }\)artanh(z))
( ) []
std::complex,
() []


namespace std {
    template<class T> class complex;
    
    template<> class complex<float>;
    template<> class complex<double>;
    template<> class complex<long double>;
    
    // operators:
    template<class T> constexpr complex<T> operator+(
        const complex<T>&, const complex<T>&);
    template<class T> constexpr complex<T> operator+(const complex<T>&, const T&);
    template<class T> constexpr complex<T> operator+(const T&, const complex<T>&);
    
    template<class T> constexpr complex<T> operator-(
        const complex<T>&, const complex<T>&);
    template<class T> constexpr complex<T> operator-(const complex<T>&, const T&);
    template<class T> constexpr complex<T> operator-(const T&, const complex<T>&);
    
    template<class T> constexpr complex<T> operator*(
        const complex<T>&, const complex<T>&);
    template<class T> constexpr complex<T> operator*(const complex<T>&, const T&);
    template<class T> constexpr complex<T> operator*(const T&, const complex<T>&);
    
    template<class T> constexpr complex<T> operator/(
        const complex<T>&, const complex<T>&);
    template<class T> constexpr complex<T> operator/(const complex<T>&, const T&);
    template<class T> constexpr complex<T> operator/(const T&, const complex<T>&);
    
    template<class T> constexpr complex<T> operator+(const complex<T>&);
    template<class T> constexpr complex<T> operator-(const complex<T>&);
    
    template<class T> constexpr bool operator==
        const complex<T>&, const complex<T>&);
    template<class T> constexpr bool operator==(const complex<T>&, const T&);
    template<class T> constexpr bool operator==(const T&, const complex<T>&);
    
    template<class T> constexpr bool operator!=(const complex<T>&, const complex<T>&);
    template<class T> constexpr bool operator!=(const complex<T>&, const T&);
    template<class T> constexpr bool operator!=(const T&, const complex<T>&);
    
    template<class T, class CharT, class Traits>
    basic_istream<CharT, Traits>&
    operator>>(basic_istream<CharT, Traits>&, complex<T>&);
    
    template<class T, class CharT, class Traits>
    basic_ostream<CharT, Traits>&
    operator<<(basic_ostream<CharT, Traits>&, const complex<T>&);
    
    // values:
    template<class T> constexpr T real(const complex<T>&);
    template<class T> constexpr T imag(const complex<T>&);
    
    template<class T> T abs(const complex<T>&);
    template<class T> T arg(const complex<T>&);
    template<class T> constexpr T norm(const complex<T>&);
    
    template<class T> constexpr complex<T> conj(const complex<T>&);
    template<class T> complex<T> proj(const complex<T>&);
    template<class T> complex<T> polar(const T&, const T& = 0);
    
    // transcendentals:
    template<class T> complex<T> acos(const complex<T>&);
    template<class T> complex<T> asin(const complex<T>&);
    template<class T> complex<T> atan(const complex<T>&);
    
    template<class T> complex<T> acosh(const complex<T>&);
    template<class T> complex<T> asinh(const complex<T>&);
    template<class T> complex<T> atanh(const complex<T>&);
    
    template<class T> complex<T> cos  (const complex<T>&);
    template<class T> complex<T> cosh (const complex<T>&);
    template<class T> complex<T> exp  (const complex<T>&);
    template<class T> complex<T> log  (const complex<T>&);
    template<class T> complex<T> log10(const complex<T>&);
    
    template<class T> complex<T> pow(const complex<T>&, const T&);
    template<class T> complex<T> pow(const complex<T>&, const complex<T>&);
    template<class T> complex<T> pow(const T&, const complex<T>&);
    
    template<class T> complex<T> sin (const complex<T>&);
    template<class T> complex<T> sinh(const complex<T>&);
    template<class T> complex<T> sqrt(const complex<T>&);
    template<class T> complex<T> tan (const complex<T>&);
    template<class T> complex<T> tanh(const complex<T>&);

    // complex literals:
    inline namespace literals {
        inline namespace complex_literals {
            constexpr complex<long double> operator""il(long double);
            constexpr complex<long double> operator""il(unsigned long long);
            constexpr complex<double> operator""i(long double);
            constexpr complex<double> operator""i(unsigned long long);
            constexpr complex<float> operator""if(long double);
            constexpr complex<float> operator""if(unsigned long long);
        }
    }
}

std::complex

template<class T>
class complex {
public:
    typedef T value_type;
    constexpr complex(const T& re = T(), const T& im = T());
    constexpr complex(const complex&);
    template<class X> constexpr complex(const complex<X>&);
    
    constexpr T real() const;
    constexpr void real(T);
    constexpr T imag() const;
    constexpr void imag(T);
    
    constexpr complex<T>& operator= (const T&);
    constexpr complex<T>& operator+=(const T&);
    constexpr complex<T>& operator-=(const T&);
    constexpr complex<T>& operator*=(const T&);
    constexpr complex<T>& operator/=(const T&);
    
    constexpr complex& operator=(const complex&);
    template<class X> constexpr complex<T>& operator= (const complex<X>&);
    template<class X> constexpr complex<T>& operator+=(const complex<X>&);
    template<class X> constexpr complex<T>& operator-=(const complex<X>&);
    template<class X> constexpr complex<T>& operator*=(const complex<X>&);
    template<class X> constexpr complex<T>& operator/=(const complex<X>&);
};

std::complex

template<> class complex<float> {
public:
    typedef float value_type;
    
    constexpr complex(float re = 0.0f, float im = 0.0f);
    explicit constexpr complex(const complex<double>&);
    explicit constexpr complex(const complex<long double>&);
    
    constexpr float real() const;
    constexpr void real(float);
    constexpr float imag() const;
    constexpr void imag(float);
    
    constexpr complex<float>& operator= (float);
    constexpr complex<float>& operator+=(float);
    constexpr complex<float>& operator-=(float);
    constexpr complex<float>& operator*=(float);
    constexpr complex<float>& operator/=(float);
    
    constexpr complex<float>& operator=(const complex<float>&);
    template<class X> constexpr complex<float>& operator= (const complex<X>&);
    template<class X> constexpr complex<float>& operator+=(const complex<X>&);
    template<class X> constexpr complex<float>& operator-=(const complex<X>&);
    template<class X> constexpr complex<float>& operator*=(const complex<X>&);
    template<class X> constexpr complex<float>& operator/=(const complex<X>&);
};

template<> class complex<double> {
public:
    typedef double value_type;
    
    constexpr complex(double re = 0.0, double im = 0.0);
    constexpr complex(const complex<float>&);
    explicit constexpr complex(const complex<long double>&);
    
    constexpr double real() const;
    constexpr void real(double);
    constexpr double imag() const;
    constexpr void imag(double);
    
    constexpr complex<double>& operator= (double);
    constexpr complex<double>& operator+=(double);
    constexpr complex<double>& operator-=(double);
    constexpr complex<double>& operator*=(double);
    constexpr complex<double>& operator/=(double);
    
    constexpr complex<double>& operator=(const complex<double>&);
    template<class X> constexpr complex<double>& operator= (const complex<X>&);
    template<class X> constexpr complex<double>& operator+=(const complex<X>&);
    template<class X> constexpr complex<double>& operator-=(const complex<X>&);
    template<class X> constexpr complex<double>& operator*=(const complex<X>&);
    template<class X> constexpr complex<double>& operator/=(const complex<X>&);
};

template<> class complex<long double> {
public:
    typedef long double value_type;
    
    constexpr complex(long double re = 0.0L, long double im = 0.0L);
    constexpr complex(const complex<float>&);
    constexpr complex(const complex<double>&);
    
    constexpr long double real() const;
    constexpr void real(long double);
    constexpr long double imag() const;
    constexpr void imag(long double);
    
    constexpr complex<long double>& operator= (const complex<long double>&);
    constexpr complex<long double>& operator= (long double);
    constexpr complex<long double>& operator+=(long double);
    constexpr complex<long double>& operator-=(long double);
    constexpr complex<long double>& operator*=(long double);
    constexpr complex<long double>& operator/=(long double);
    
    template<class X> constexpr complex<long double>& operator= (const complex<X>&);
    template<class X> constexpr complex<long double>& operator+=(const complex<X>&);
    template<class X> constexpr complex<long double>& operator-=(const complex<X>&);
    template<class X> constexpr complex<long double>& operator*=(const complex<X>&);
    template<class X> constexpr complex<long double>& operator/=(const complex<X>&);
};

C++:

LWG 79 C++98 the default argument of the second parameter
of polar was missing in the synopsis
added

Web Proxy Viewer  |  New URL  |  Original Page