Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::complex<T>::operator+=,-=,*=,/=

      From cppreference.com
      <cpp‎ |numeric‎ |complex
       
       
       
       
      Primary templatecomplex<T>
      (1)
      complex& operator+=(const T& other);
      (until C++20)
      constexpr complex& operator+=(const T& other);
      (since C++20)
      (2)
      complex& operator-=(const T& other);
      (until C++20)
      constexpr complex& operator-=(const T& other);
      (since C++20)
      (3)
      complex& operator*=(const T& other);
      (until C++20)
      constexpr complex& operator*=(const T& other);
      (since C++20)
      (4)
      complex& operator/=(const T& other);
      (until C++20)
      constexpr complex& operator/=(const T& other);
      (since C++20)
      Specializationcomplex<float>
      (1)
      complex& operator+=(float other);
      (until C++20)
      constexpr complex& operator+=(float other);
      (since C++20)
      (2)
      complex& operator-=(float other);
      (until C++20)
      constexpr complex& operator-=(float other);
      (since C++20)
      (3)
      complex& operator*=(float other);
      (until C++20)
      constexpr complex& operator*=(float other);
      (since C++20)
      (4)
      complex& operator/=(float other);
      (until C++20)
      constexpr complex& operator/=(float other);
      (since C++20)
      Specializationcomplex<double>
      (1)
      complex& operator+=(double other);
      (until C++20)
      constexpr complex& operator+=(double other);
      (since C++20)
      (2)
      complex& operator-=(double other);
      (until C++20)
      constexpr complex& operator-=(double other);
      (since C++20)
      (3)
      complex& operator*=(double other);
      (until C++20)
      constexpr complex& operator*=(double other);
      (since C++20)
      (4)
      complex& operator/=(double other);
      (until C++20)
      constexpr complex& operator/=(double other);
      (since C++20)
      Specializationcomplex<long double>
      (1)
      complex& operator+=(longdouble other);
      (until C++20)
      constexpr complex& operator+=(longdouble other);
      (since C++20)
      (2)
      complex& operator-=(longdouble other);
      (until C++20)
      constexpr complex& operator-=(longdouble other);
      (since C++20)
      (3)
      complex& operator*=(longdouble other);
      (until C++20)
      constexpr complex& operator*=(longdouble other);
      (since C++20)
      (4)
      complex& operator/=(longdouble other);
      (until C++20)
      constexpr complex& operator/=(longdouble other);
      (since C++20)
      All specializations
      (5)
      template<class X>
      complex& operator+=(conststd::complex<X>& other);
      (until C++20)
      template<class X>
      constexpr complex& operator+=(conststd::complex<X>& other);
      (since C++20)
      (6)
      template<class X>
      complex& operator-=(conststd::complex<X>& other);
      (until C++20)
      template<class X>
      constexpr complex& operator-=(conststd::complex<X>& other);
      (since C++20)
      (7)
      template<class X>
      complex& operator*=(conststd::complex<X>& other);
      (until C++20)
      template<class X>
      constexpr complex& operator*=(conststd::complex<X>& other);
      (since C++20)
      (8)
      template<class X>
      complex& operator/=(conststd::complex<X>& other);
      (until C++20)
      template<class X>
      constexpr complex& operator/=(conststd::complex<X>& other);
      (since C++20)

      Implements the compound assignment operators for complex arithmetic and for mixed complex/scalar arithmetic. Scalar arguments are treated as complex numbers with the real part equal to the argument and the imaginary part set to zero.

      1,5) Addsother to*this.
      2,6) Subtractsother from*this.
      3,7) Multiplies*this byother.
      4,8) Divides*this byother.

      [edit]Parameters

      other - a complex or scalar value of matching type (float,double,longdouble)

      [edit]Return value

      *this

      [edit]See also

      applies unary operators to complex numbers
      (function template)[edit]
      performs complex number arithmetic on two complex values or a complex and a scalar
      (function template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/numeric/complex/operator_arith&oldid=138939"

      [8]ページ先頭

      ©2009-2025 Movatter.jp