Function getProductFromBounds

  • Computes the product of factors given an inclusive lower bound and inclusive upper bound.

    • This method runs in linear time, or O(n), where n = upperBound - lowerBound
    • In mathematics, it is formally written using the Greek Capital Pi (Π) notation.
    • If there are zero factors, it will return the empty product (also known as the nullary product and vacuous product), which is equal 1 per the multiplicative identity.

    Parameters

    • lowerBound: number

      Lower bound of the product

    • upperBound: number

      Upper bound of the product

    • lambda: ((n) => number) = ...

      A single-parameter function for mutating each number

        • (n): number
        • Parameters

          • n: number

          Returns number

    Returns number

    Throws

    RangeError if the lowerBound is greater than the upperBound

Generated using TypeDoc