Skip to main content

Mojo function

product

product[size: Int](tuple: IndexList[size, element_bitwidth=element_bitwidth, unsigned=unsigned], end_idx: Int) -> Int

Computes a product of values in the tuple up to the given index.

Parameters:

  • size (Int): The tuple size.

Args:

  • tuple (IndexList[size, element_bitwidth=element_bitwidth, unsigned=unsigned]): The tuple to get a product of.
  • end_idx (Int): The end index.

Returns:

The product of all tuple elements in the given range.

product[size: Int](tuple: IndexList[size, element_bitwidth=element_bitwidth, unsigned=unsigned], start_idx: Int, end_idx: Int) -> Int

Computes a product of values in the tuple in the given index range.

Parameters:

  • size (Int): The tuple size.

Args:

  • tuple (IndexList[size, element_bitwidth=element_bitwidth, unsigned=unsigned]): The tuple to get a product of.
  • start_idx (Int): The start index of the range.
  • end_idx (Int): The end index of the range.

Returns:

The product of all tuple elements in the given range.