Class LeastCommonMultiple

java.lang.Object
org.zfcj.math.numbers.LeastCommonMultiple
All Implemented Interfaces:
org.zfcj.math.set.Function<Integer[],Integer>, org.zfcj.math.set.relation.BinaryRelation<Integer[],Integer>

public class LeastCommonMultiple extends Object implements org.zfcj.math.set.Function<Integer[],Integer>
A Function that calculates the least common multiple of a set of Integers
  • Constructor Details

    • LeastCommonMultiple

      public LeastCommonMultiple()
  • Method Details

    • apply

      public Integer apply(Integer[] ints)
      Description copied from interface: org.zfcj.math.set.Function
      Applies the function to the given input element x and returns its corresponding output element
      Specified by:
      apply in interface org.zfcj.math.set.Function<Integer[],Integer>
    • calculate

      public static Integer calculate(Integer... ints)
      Returns the least common multiple of the given integers
      Parameters:
      ints - the integers
      Returns:
      the integers' least common mulitple
    • calculate

      public static Integer calculate(int... ints)
      Returns the least common multiple of the given integers
      Parameters:
      ints - the integers
      Returns:
      the integers' least common mulitple
    • calculate

      public static Integer calculate(long... longs)
      Returns the least common multiple of the given longs
      Parameters:
      longs - the integers
      Returns:
      the integers' least common mulitple
    • calculate

      public static Integer calculate(BigInteger... bigs)
      Returns the least common multiple of the given integers
      Parameters:
      bigs - the integers
      Returns:
      the integers' least common mulitple