Linear congruential generator: Difference between revisions

Content added Content deleted
m (→‎{{header|Phix}}: bigatom -> mpfr)
Line 1,598: Line 1,598:


=={{header|Julia}}==
=={{header|Julia}}==
{{works with|Julia|0.6}}

<tt>getlgc</tt> creates a linear congruential generator as a closure. This function is used to create the two generators called for by the task.
<tt>getlgc</tt> creates a linear congruential generator as a closure. This function is used to create the two generators called for by the task.
<lang julia>using Printf
<lang julia>function getlgc(r::Integer, a::Integer, c::Integer, m::Integer, sh::Integer)

function getlgc(r::Integer, a::Integer, c::Integer, m::Integer, sh::Integer)
state = r
state = r
return function lgcrand()
return function lgcrand()