This shows you the differences between two versions of the page.
| xrpl:randint [2019/03/04 00:55] – created Karsten75 | xrpl:randint [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | |||
| - | ===== RANDINT | ||
| - | |||
| - | ^Arguments^Result^Notation^ | ||
| - | | Number 1, Number 2 | Int | [ i1 i2 - i3 ] | | ||
| - | |||
| - | |||
| - | === Description === | ||
| - | Returns a random integer from a range of two numbers exclusive of the max number. | ||
| - | |||
| - | === Examples === | ||
| - | < | ||
| - | int min = GetIntFromStack(); | ||
| - | stack.Push(new Data(min+amt)); | ||
| - | |||
| - | 0 10 RandInt -> | ||
| - | // Inclusive min Exclusive max means that 0 10 RandInt CAN [inclusive] pick 0 [min] but cannot [exclusive] pick 10 [max] | ||
| - | // A workaround for between 0 and 10 both inclusive is to do 0 11 RandInt, so 11 will exclude but 10 will include [basically, 0 10 1 add RandInt] | ||
| - | <-Int trace | ||
| - | </ | ||