HUGO
Menu
GitHub 90265 stars Mastodon

math.Div

Returns the result of dividing the first number by one or more numbers.
Syntax
math.Div VALUE VALUE...
Returns
any
Alias
div

Usage

The math.Div function returns the result of dividing the first number by one or more numbers. If one of the numbers is a float, the result is a float. Otherwise, the function performs integer division and removes the fractional part of the result.

Examples

{{ math.Div 12 3 2 }} → 2

Comparing integer and floating-point division:

{{ math.Div 5 2 }} → 2
{{ math.Div 5 2.0 }} → 2.5