Abstraction of numeric types with the usual binary operations:

• subtraction, x - y,
• multiplication, x * y, and
• division, x / y, along with

A concrete class which implements this interface should be a mathematical ring. That is:

• both addition, +, and multiplication, *, should be associative and commutative,
• there should be additive and multiplicative identities, denoted 0 and 1 respectively, satisfying x+0 == x and x*1 == x,
• every instance x should have an additive inverse -x, satisfying x + -x == 0, and
• multiplication should distribute over addition, satisfying x*(y+z) == x*y + x*z.

It is preferred, but not required, that the class be a mathematical field. That is, in addition to the above:

• every instance x such that x!=0 should have a multiplicative inverse 1/x, satisfying x * 1/x == 1.

For numeric types which are not fields, for example, Integer, there is still a division operation, which is understood to produce a remainder. The division operation should satisfy:

• x*y / y == x

for any instance y other than 0.

For numeric types which are fields, division never produces a remainder, and division should additionally satisfy:

• x/y * y == x

for any instance y other than 0.

Some numeric types, for example complex numbers, do not have a total order. Numeric types with a total order also satisfy Number.

By: Gavin