User Tools

Site Tools


function:RAND

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
function:RAND [2019/07/04 03:32]
peternlewis
function:RAND [2023/09/20 03:35] (current)
peternlewis
Line 1: Line 1:
-The //RAND()// functions return a random integer number.+====== RAND Function ====== 
 + 
 +The RAND() functions return a random integer number.
  
 * RAND(N) returns a random integer from 0 to, but not including, N. * RAND(N) returns a random integer from 0 to, but not including, N.
Line 6: Line 8:
 In the one parameter version, N must be greater than or equal to 1. In the one parameter version, N must be greater than or equal to 1.
  
-In the two parameter version, ​A must not equal B, and if B is less than A, they are implicitly swapped.+In the two parameter version, if B is less than A, they are implicitly swapped. If A and B are the same, then that is the number that will always be returned.
  
-Note: Unlike ​all the other variants of //RAND()// and [[function:RANDOM|RANDOM()]],​ RAND(A,B) may return the larger number. ​ This makes RAND(1,6) return the same as a regular dice for example, a number from 1-6 inclusive, which matches what you would normally want.+Note: Unlike the other variants of RAND() and [[RANDOM|RANDOM()]],​ RAND(A,B) may return the larger number. ​ This makes RAND(1,6) return the same as a regular dice for example, a number from 1-6 inclusive, which matches what you would normally want.
  
 ===== See Also ===== ===== See Also =====
Line 14: Line 16:
 ==== Functions ==== ==== Functions ====
  
-* [[function:RANDOM]]+* [[RANDOM]]
 * [[:​Functions|See all Functions]] * [[:​Functions|See all Functions]]
function/RAND.1562225549.txt.gz · Last modified: 2019/07/04 03:32 by peternlewis