IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.0
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

product

product[size: Int](tuple: IndexList[size, element_type=tuple.element_type], end_idx: Int = size) -> Int

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

Parameters:

  • size (Int): The tuple size.

Args:

Returns:

Int: The product of all tuple elements in the given range.

product[size: Int](tuple: IndexList[size, element_type=tuple.element_type], 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:

Returns:

Int: The product of all tuple elements in the given range.