Interface NativeOperators<T>

Type Parameters:
T - Type of elements.
All Superinterfaces:
Addition<T>, Multiplication<T>
All Known Implementing Classes:
BigFraction, FP64, Fraction

public interface NativeOperators<T> extends Addition<T>, Multiplication<T>
Operators that can be implemented in a more performant way using the language constructs.
  • Method Summary

    Modifier and Type
    Method
    Description
    divide(T a)
    Binary division.
    multiply(int n)
    Repeated addition.
    pow(int n)
    Repeated multiplication.
    Binary subtraction.

    Methods inherited from interface org.apache.commons.numbers.core.Addition

    add, negate, zero

    Methods inherited from interface org.apache.commons.numbers.core.Multiplication

    multiply, one, reciprocal
  • Method Details

    • subtract

      T subtract(T a)
      Binary subtraction.
      Parameters:
      a - Element.
      Returns:
      this - a.
    • divide

      T divide(T a)
      Binary division.
      Parameters:
      a - Element.
      Returns:
      this / a.
    • multiply

      T multiply(int n)
      Repeated addition.
      Parameters:
      n - Number of times to add this to itself.
      Returns:
      n * this.
    • pow

      T pow(int n)
      Repeated multiplication.
      Parameters:
      n - Number of times to multiply this with itself.
      Returns:
      this^n.