-= (subtract assign) operator
The right-associative, binary -= operator decrements it's left-hand operand
by the amount given by its right-hand operand.
Usage
variable Integer num = 4; num -= 1; // decrement num by 1 num -= num; // decrement num by 3
Description
Definition
The -= operator is defined as follows:
lhs = lhs.minus(rhs)
except that lhs is evaluated only once.
See the language specification for more details.
Polymorphism
The -= operator is polymorphic.
The definition of the -= operator depends
on the Numeric interface.
See also
- arithmetic operators in the language specification
- operator precedence in the language specification
- Operator polymorphism and Numeric operator semantics in the Tour of Ceylon