Skip to content

Commit 913a1b3

Browse files
authored
Merge pull request #25 from per1234/random-max-note
Add note about max parameter to random() reference page
2 parents 7033e84 + 9c3897e commit 913a1b3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Language/Functions/Random Numbers/random.adoc

+2
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,7 @@ If it is important for a sequence of values generated by `random()` to differ, o
8989

9090
Conversely, it can occasionally be useful to use pseudo-random sequences that repeat exactly. This can be accomplished by calling `randomSeed()` with a fixed number, before starting the random sequence.
9191

92+
The `max` parameter should be chosen according to the data type of the variable in which the value is stored. In any case, the absolute maximum is bound to the `long` nature of the value generated (32 bit - 2,147,483,647). Setting `max` to a higher value won't generate an error during compilation, but during sketch execution the numbers generated will not be as expected.
93+
9294
--
9395
// HOW TO USE SECTION ENDS

0 commit comments

Comments
 (0)