Go Package math: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 13: | Line 13: | ||
:https://gobyexample.com/random-numbers<br> | :https://gobyexample.com/random-numbers<br> | ||
</blockquote> | </blockquote> | ||
To get a pseudo-random non-negative int between 0 (inclusive) and n (exclusive), use: | |||
<pre> | |||
rand.Intn(n int) int | |||
</pre> |
Revision as of 20:43, 2 April 2016
External
Internal
Random Numbers
To get a pseudo-random non-negative int between 0 (inclusive) and n (exclusive), use:
rand.Intn(n int) int