X | A type that is a model of AdditiveGroup |
Y | A type that is a model of AdditiveGroup |
x | Object of type X |
y | Object of type Y |
Name | Expression | Type requirements | Return type |
---|---|---|---|
Addition | x + y | X | |
Addition | x += y | y is convertible to X | X |
Negation | - x | X | |
Subtraction | x - y | X | |
Subtraction | x -= y | y is convertible to X | X |
Name | Expression | Precondition | Semantics | Postcondition |
---|---|---|---|---|
Addition | x + y | |||
Addition | x += y | Is equivalent to x = x + y | ||
Negation | - x | |||
Subtraction | x - y | |||
Subtraction | x -= y | Is equivalent to x = x - y |