tpl: Add math.Sqrt

Fixes #6941
This commit is contained in:
Chris Dennis 2020-02-24 22:45:04 +00:00 committed by GitHub
parent 322c285ba2
commit d184e5059c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 1 deletions

View file

@ -4,7 +4,7 @@ description: Hugo provides nine mathematical operators in templates.
godocref:
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
lastmod: 2020-02-23
keywords: [math, operators]
categories: [functions]
menu:
@ -36,3 +36,6 @@ aliases: []
| `math.Ceil` | Returns the least integer value greater than or equal to the given number. | `{{math.Ceil 2.1}}` → `3` |
| `math.Floor` | Returns the greatest integer value less than or equal to the given number. | `{{math.Floor 1.9}}` → `1` |
| `math.Round` | Returns the nearest integer, rounding half away from zero. | `{{math.Round 1.5}}` → `2` |
| `math.Log` | Returns the natural logarithm of the given number. | `{{math.Log 42}}` → `3.737` |
| `math.Sqrt` | Returns the square root of the given number. | `{{math.Sqrt 81}}` → `9` |