[ Web Proxy ]
URL:
Viewing: https://fr.cppreference.com/cpp/numeric/complex/operator_arith3 [Back]  [Original]

std::complex::operator+(binary), operator-(binary), operator*, operator/ cppreference.com
cppreference.com
Espaces de noms
Variantes

std::complex::operator+(binary), operator-(binary), operator*, operator/

De cppreference.com

<metanoindex/>

 
 
Bibliothque Numerics
Fonctions mathmatiques courantes
Virgule flottante environnement
Nombres complexes
Tableaux numriques
La gnration de nombres pseudo-alatoires
Moment de la compilation arithmtique rationnelle (C++11)
Gnriques des oprations numriques
Original:
Generic numeric operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
iota (C++11)
accumulate
inner_product
adjacent_difference
partial_sum
 
Nombres complexes
Les fonctions membres
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
complex::complex
complex::operator=
complex::real
complex::imag
complex::operator+=
complex::operator-=
complex::operator*=
complex::operator/=
Tiers fonctions
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
operator==
operator!=
operator<<
operator>>
real
imag
abs
arg
norm
conj
proj (C++11)
polar
Les fonctions exponentielles
Original:
Exponential functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
exp
log
log10
Les fonctions de puissance
Original:
Power functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pow
sqrt
Les fonctions trigonomtriques
Original:
Trigonometric functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
asin (C++11)
acos (C++11)
atan (C++11)
Fonctions hyperboliques
Original:
Hyperbolic functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
asinh (C++11)
acosh (C++11)
atanh (C++11)
 
<tbody> </tbody>
template< class T > complex<T> operator+( const complex<T>& lhs, const complex<T>& rhs);
(1)
template< class T > complex<T> operator+( const complex<T>& lhs, const T& rhs);
(2)
template< class T > complex<T> operator+( const T& lhs, const complex<T>& rhs);
(3)
template< class T > complex<T> operator-( const complex<T>& lhs, const complex<T>& rhs);
(4)
template< class T > complex<T> operator-( const complex<T>& lhs, const T& rhs);
(5)
template< class T > complex<T> operator-( const T& lhs, const complex<T>& rhs);
(6)
template< class T > complex<T> operator*( const complex<T>& lhs, const complex<T>& rhs);
(7)
template< class T > complex<T> operator*( const complex<T>& lhs, const T& rhs);
(8)
template< class T > complex<T> operator*( const T& lhs, const complex<T>& rhs);
(9)
template< class T > complex<T> operator/( const complex<T>& lhs, const complex<T>& rhs);
(10)
template< class T > complex<T> operator/( const complex<T>& lhs, const T& rhs);
(11)
template< class T > complex<T> operator/( const T& lhs, const complex<T>& rhs);
(12)
Met en uvre les oprateurs binaires pour l'arithmtique complexe et mixte complexe / scalaire arithmtique. Arguments scalaires sont traites comme des nombres complexes avec la partie relle gale l'argument et la partie imaginaire zro .
Original:
Implements the binary 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.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
1-3)
Renvoie la somme de ses arguments
Original:
Returns the sum of its arguments
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
4-6)
Retourne le rsultat de la soustraction de rhs lhs
Original:
Returns the result of subtracting rhs from lhs
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
7-9)
Multiplie ses arguments
Original:
Multiplies its arguments
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
10-12)
Divise par lhs rhs
Original:
Divides lhs by rhs
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Paramtres

lhs, rhs -
les arguments: soit les deux nombres complexes ou d'un complexe et un scalaire de type correspondant (float, double, long double)
Original:
the arguments: either both complex numbers or one complex and one scalar of matching type (float, double, long double)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Retourne la valeur

1-3) complex<T>(lhs) += rhs
4-6) complex<T>(lhs) -= rhs
7-9) complex<T>(lhs) *= rhs
10-12) complex<T>(lhs) /= rhs

Exemple

#include <iostream>
#include <complex>
int main()
{
    std::complex<double> c2(2, 0);
    std::complex<double> ci(0, 1);

    std::cout << ci << " + " << c2 << " = " << ci+c2 << '\n'
              << ci << " * " << ci << " = " << ci*ci << '\n'
              << ci << " + " << c2 << " / " << ci << " = " << ci+c2/ci << '\n'
              << 1  << " / " << ci << " = " << 1./ci << '\n';

//    std::cout << 1.f/ci; // compile error
//    std::cout << 1/ci; // compile error
}

Rsultat :

(0,1) + (2,0) = (2,1)
(0,1) * (0,1) = (-1,0)
(0,1) + (2,0) / (0,1) = (0,-1)
1 / (0,1) = (0,-1)

Voir aussi

assignation compose de deux nombres complexes ou un complexe et un scalaire
Original:
compound assignment of two complex numbers or a complex and a scalar
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction membre publique) [edit]
s'applique oprateurs unaires aux nombres complexes
Original:
applies unary operators to complex numbers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction gnrique) [edit]

Web Proxy Viewer  |  New URL  |  Original Page