prod

Calculates the product of the elements of the input.

This function uses a separate exponential accumulation algorithm to calculate the product. A consequence of this is that the result must be a floating point type. To calculate the product of a type that is not implicitly convertible to a floating point type, use mir.algorithm.iteration.reduce or mir.algorithm.iteration.fold.

/++

  1. F prod(Range r)
    F
    prod
    (
    F
    Range
    )
    (
    Range r
    )
    if (
    isFloatingPoint!F &&
    isIterable!Range
    )
  2. F prod(Range r, long exp)
  3. prodType!Range prod(Range r)
  4. prodType!Range prod(Range r, long exp)
  5. prodType!T prod(T[] ar)

Parameters

r Range

finite iterable range

Return Value

Type: F

The prduct of all the elements in r +/

See Also

Meta