Go Package math: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=Internal= * Go Concepts") |
No edit summary |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=External= | |||
* https://golang.org/pkg/math/ | |||
* https://golang.org/pkg/math/rand/ | |||
=Internal= | =Internal= | ||
* [[ | * [[Go_Language_Modularization#math|Standard Library]] | ||
=Random Numbers= | |||
<blockquote style="background-color: AliceBlue; border: solid thin LightSteelBlue;"> | |||
:https://gobyexample.com/random-numbers<br> | |||
</blockquote> | |||
To get a pseudo-random non-negative int between 0 (inclusive) and n (exclusive), use: | |||
<pre> | |||
rand.Intn(n int) int | |||
</pre> |
Latest revision as of 22:14, 6 September 2023
External
Internal
Random Numbers
To get a pseudo-random non-negative int between 0 (inclusive) and n (exclusive), use:
rand.Intn(n int) int