Pseudo-random numbers/Splitmix64: Difference between revisions

m
→‎{{header|REXX}}: changed output format, reduce the number of decimal digits for calculations.
(→‎{{header|REXX}}: added the computer programming language REXX.)
m (→‎{{header|REXX}}: changed output format, reduce the number of decimal digits for calculations.)
Line 307:
=={{header|REXX}}==
<lang rexx>/*REXX program generates pseudo─random numbers using the split mix 64 bit method.*/
numeric digits 400200 /*ensure enough decimal digs for mult. */
parse arg n reps pick seed1 seed2 . /*obtain optional arguments from the CL*/
if n=='' | n=="," then n= 5 /*Not specified? Then use the default.*/
Line 330:
say
if reps==0 then exit 0 /*stick a fork in it, we're all done. */
say center('#', w) " count of pseudo─random #"
say copies('═', w) " ══════════════════════════════════════════════════════"
state= seed2 /* " the state to seed #2. */
@.= 0; div= pick / 2**64 /*convert division to inverse multiply.*/
Line 340:
 
do #=0 for pick
say right(#':', w)" " right(commas(@.#), 1415) /*show count of a random num.*/
end /*#*/
exit 0 /*stick a fork in it, we're all done. */
Line 367:
5: 16,408,922,859,458,223,821
 
# count of pseudo─random #
═══ ════════════════════════════
═══ ══════════════════════════
0: 20,027
1: 19,892
2: 20,073
3: 19,978
4: 20,030
</pre>