org.apache.commons.math3

## Interface FieldElement<T>

- Type Parameters:
    `T` - the type of the field elements
  All Known Implementing Classes:
    BigFraction, BigReal, Complex, Dfp, DfpDec, Fraction

      public interface FieldElement<T>

  Interface representing field elements.
  Since:
    2.0
  Version:
    $Id: FieldElement.java 1293898 2012-02-26 17:58:07Z celestin $
  See Also:
    `Field`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `add(T a)` Compute this + a.
    `T` | `divide(T a)` Compute this ÷ a.
    `Field<T>` | `getField()` Get the `Field` to which the instance belongs.
    `T` | `multiply(int n)` Compute n × this.
    `T` | `multiply(T a)` Compute this × a.
    `T` | `negate()` Returns the additive inverse of `this` element.
    `T` | `reciprocal()` Returns the multiplicative inverse of `this` element.
    `T` | `subtract(T a)` Compute this - a.

- - ### Method Detail

    - #### add

          T add(T a)

      Compute this + a.
      Parameters:
        `a` - element to add
      Returns:
        a new element representing this + a

    - #### subtract

          T subtract(T a)

      Compute this - a.
      Parameters:
        `a` - element to subtract
      Returns:
        a new element representing this - a

    - #### negate

          T negate()

      Returns the additive inverse of `this` element.
      Returns:
        the opposite of `this`.

    - #### multiply

          T multiply(int n)

      Compute n × this. Multiplication by an integer number is defined as the following sum
      n × this = ∑i=1n this.
      Parameters:
        `n` - Number of times `this` must be added to itself.
      Returns:
        A new element representing n × this.

    - #### multiply

          T multiply(T a)

      Compute this × a.
      Parameters:
        `a` - element to multiply
      Returns:
        a new element representing this × a

    - #### divide

          T divide(T a)

      Compute this ÷ a.
      Parameters:
        `a` - element to add
      Returns:
        a new element representing this ÷ a

    - #### reciprocal

          T reciprocal()

      Returns the multiplicative inverse of `this` element.
      Returns:
        the inverse of `this`.

    - #### getField

          Field<T> getField()

      Get the `Field` to which the instance belongs.
      Returns:
        `Field` to which the instance belongs

Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.