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:
- tuple (
IndexList[size, element_type=tuple.element_type]): The tuple to get a product of. - end_idx (
Int): The end index.
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:
- tuple (
IndexList[size, element_type=tuple.element_type]): 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:
Int: The product of all tuple elements in the given range.