Abstraction of additive numeric types which
support a unary operation -x
producing the additive
inverse of x
. Every Invertible
type supports a binary
subtraction operation x-y
.
Integer negativeOne = -1; Float delta = x-y;
A concrete class that implements this interface should be a
mathematical group. That is, it should have an additive
identity, denoted 0
, and satisfy:
0+x == x+0 == x
x + -x == 0
Subtraction must be defined so that it is consistent with the additive inverse:
x - y == x + -y
no type hierarchy
Attributes | |
negated | Source Codeshared formal Other negated The additive inverse of this value. |
Inherited Attributes |
Attributes inherited from: Object |
Methods | |
minus | Source Codeshared default Other minus(Other other) The difference between this number and the given
number. Must produce the value |
Inherited Methods |
Methods inherited from: Object |
Methods inherited from: Summable<Other> |