Jump to content

Linear congruential generator: Difference between revisions

m
m (→‎{{header|Phix}}: bigatom -> mpfr)
Line 1,598:
 
=={{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.
<lang julia>using Printf
<lang julia>function getlgc(r::Integer, a::Integer, c::Integer, m::Integer, sh::Integer)
 
<lang julia>function getlgc(r::Integer, a::Integer, c::Integer, m::Integer, sh::Integer)
state = r
return function lgcrand()
4,105

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.