@@ -28,13 +28,12 @@ Arithmetic conversions
2828.. index :: pair: arithmetic; conversion
2929
3030When a description of an arithmetic operator below uses the phrase "the numeric
31- arguments are converted to a common type", this means that the operator
31+ arguments are converted to a common real type", this means that the operator
3232implementation for built-in types works as follows:
3333
34- * If either argument is a complex number, the other is converted to complex ;
34+ * If both arguments are complex numbers, no conversion is performed ;
3535
36- * otherwise, if either argument is a floating-point number, the other is
37- converted to floating point;
36+ * if either argument is a complex or a floating-point number, the other is converted to a floating-point number;
3837
3938* otherwise, both must be integers and no conversion is necessary.
4039
@@ -1323,12 +1322,16 @@ operators and one for additive operators:
13231322The ``* `` (multiplication) operator yields the product of its arguments. The
13241323arguments must either both be numbers, or one argument must be an integer and
13251324the other must be a sequence. In the former case, the numbers are converted to a
1326- common type and then multiplied together. In the latter case, sequence
1325+ common real type and then multiplied together. In the latter case, sequence
13271326repetition is performed; a negative repetition factor yields an empty sequence.
13281327
13291328This operation can be customized using the special :meth: `~object.__mul__ ` and
13301329:meth: `~object.__rmul__ ` methods.
13311330
1331+ .. versionchanged :: 3.14
1332+ If only one operand is a complex number, the other operand is converted
1333+ to a floating-point number.
1334+
13321335.. index ::
13331336 single: matrix multiplication
13341337 pair: operator; @ (at)
@@ -1396,23 +1399,31 @@ floating-point number using the :func:`abs` function if appropriate.
13961399
13971400The ``+ `` (addition) operator yields the sum of its arguments. The arguments
13981401must either both be numbers or both be sequences of the same type. In the
1399- former case, the numbers are converted to a common type and then added together.
1402+ former case, the numbers are converted to a common real type and then added together.
14001403In the latter case, the sequences are concatenated.
14011404
14021405This operation can be customized using the special :meth: `~object.__add__ ` and
14031406:meth: `~object.__radd__ ` methods.
14041407
1408+ .. versionchanged :: 3.14
1409+ If only one operand is a complex number, the other operand is converted
1410+ to a floating-point number.
1411+
14051412.. index ::
14061413 single: subtraction
14071414 single: operator; - (minus)
14081415 single: - (minus); binary operator
14091416
14101417The ``- `` (subtraction) operator yields the difference of its arguments. The
1411- numeric arguments are first converted to a common type.
1418+ numeric arguments are first converted to a common real type.
14121419
14131420This operation can be customized using the special :meth: `~object.__sub__ ` and
14141421:meth: `~object.__rsub__ ` methods.
14151422
1423+ .. versionchanged :: 3.14
1424+ If only one operand is a complex number, the other operand is converted
1425+ to a floating-point number.
1426+
14161427
14171428.. _shifting :
14181429
0 commit comments