(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/ref/power.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/ref/expressions.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/ref/binary.html| ]]
|
Python Reference Manual
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/ref/contents.html| ]]
|
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/ref/genindex.html| ]]
|
Previous: 5.4 The power operator Up: 5. Expressions Next: 5.6 Binary arithmetic operations
5.5 Unary arithmetic operations
All unary arithmetic (and bit-wise) operations have the same priority:
u_expr: power | "-" u_expr | "+" u_expr | "~" u_expr
The unary - (minus) operator yields the negation of its numeric argument.
The unary + (plus) operator yields its numeric argument unchanged.
The unary ~ (invert) operator yields the bit-wise inversion of its plain or long integer argument. The bit-wise inversion of x is defined as -(x+1). It only applies to integral numbers.
In all three cases, if the argument does not have the proper type, a TypeError exception is raised.
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/ref/power.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/ref/expressions.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/ref/binary.html| ]]
|
Python Reference Manual
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/ref/contents.html| ]]
|
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/ref/genindex.html| ]]
|
Previous: 5.4 The power operator Up: 5. Expressions Next: 5.6 Binary arithmetic operations
See About this document... for information on suggesting changes.