OxL Reference

method List.product

The product of the elements (1 for an empty list); panics on overflow like *.

Example:

oxl✓ checked in CI
fn main() io {
  let xs: List<u32> = [1, 2, 3, 4]
  print("{xs.product()}")
}
Output
24
pub(api) fn product() -> u32

Complexity. O(n).

Since. 1.0.0-beta

Returns

u32

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/numbers.oxl:5088

See also