Class RationalAddition

java.lang.Object
org.zfcj.math.numbers.RationalAddition
All Implemented Interfaces:
org.zfcj.math.set.BiFunction<RationalNumber,RationalNumber,RationalNumber>, org.zfcj.math.set.BinaryOperator<RationalNumber>

public class RationalAddition extends Object implements org.zfcj.math.set.BinaryOperator<RationalNumber>
A BinaryOperator that add two RationalNumbers and returns the sum
  • Constructor Details

    • RationalAddition

      public RationalAddition()
  • Method Details

    • apply

      Description copied from interface: org.zfcj.math.set.BiFunction
      Applies the function to the given input elements t and u and returns the corresponding output element
      Specified by:
      apply in interface org.zfcj.math.set.BiFunction<RationalNumber,RationalNumber,RationalNumber>
      Parameters:
      t - an element of the first set
      u - an element of the second set
    • calculate

      public static RationalNumber calculate(RationalNumber t, RationalNumber u)
      Calculates the sum of addition of the given RationalNumber summands
      Parameters:
      t - the first summand
      u - the second summand
      Returns:
      the sum of the given rational numbers