mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit '346b60358dd8ec2ca228e6635bff9d7914b398b7'
This commit is contained in:
@@ -12,13 +12,13 @@ action:
|
||||
|
||||
{{< new-in 0.121.2 >}}
|
||||
|
||||
The `math.Rand` function returns a pseudo-random number in the [half-open interval] [0.0, 1.0).
|
||||
The `math.Rand` function returns a pseudo-random number in the half-open [interval](g) [0.0, 1.0).
|
||||
|
||||
```go-html-template
|
||||
{{ math.Rand }} → 0.6312770459590062
|
||||
```
|
||||
|
||||
To generate a random integer in the [closed interval] [0, 5]:
|
||||
To generate a random integer in the closed interval [0, 5]:
|
||||
|
||||
```go-html-template
|
||||
{{ math.Rand | mul 6 | math.Floor }}
|
||||
@@ -41,6 +41,3 @@ To generate a random float, with one digit after the decimal point, in the close
|
||||
```go-html-template
|
||||
{{ div (math.Rand | mul 50 | math.Ceil) 10 }}
|
||||
```
|
||||
|
||||
[closed interval]: /getting-started/glossary/#interval
|
||||
[half-open interval]: /getting-started/glossary/#interval
|
||||
|
Reference in New Issue
Block a user