math.Product
Returns the product of all numbers. Accepts scalars, slices, or both.
- Syntax
- math.Product VALUE...
- Returns
- float64
Usage
The math.Product function returns the product of all numbers. Each argument can be a number or a slice of numbers.
Examples
{{ math.Product 2 3 }} → 6With a slice:
{{ math.Product (slice 1 2 3 4) }} → 24With numbers and slices:
{{ math.Product 1 (slice 2 3) 4 }} → 24Last updated:
October 21, 2026
:
content: Apply style guide to math functions (658ef2b60)
Improve this page