Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |
| cw4:4rpl_tools [2025/08/29 15:56] – [Pseudo RNG based on Linear congruential generator (LCG)] kalli | cw4:4rpl_tools [2025/08/29 21:04] (current) – [Pseudo RNG based on Linear congruential generator (LCG)] kalli |
|---|
| ->last | ->last |
| ->first | ->first |
| elapsedtime dup 10 log ceil 7 sub neg 10 swap pow mul asint <-spikedLcgAdd dup 1 add ->spikedLcgAdd mul @seededLcgRand01 <-last <-first sub mul <-first add asint | elapsedtime dup 10 log ceil 7 sub neg 10 swap pow mul asint <-spikedLcgAdd 1 add dup ->spikedLcgAdd mul @seededLcgRand01 <-last <-first sub mul <-first add asint |
| | |
| :spikedLcgRand01 | :spikedLcgRand01 |
| elapsedtime dup 10 log ceil 7 sub neg 10 swap pow mul asint <-spikedLcgAdd dup 1 add ->spikedLcgAdd mul @seededLcgRand01 | elapsedtime dup 10 log ceil 7 sub neg 10 swap pow mul asint <-spikedLcgAdd 1 add dup ->spikedLcgAdd mul @seededLcgRand01 |
| |
| :seededLcgRandInt # INPUT: integer seed + integer first randInt + integer last randInt. OUTPUT: an integer in between the first and last randInt, excluding the last randInt. | :seededLcgRandInt # INPUT: integer seed + integer first randInt + integer last randInt. OUTPUT: an integer in between the first and last randInt, excluding the last randInt. |