Re: gnuplot random numbers

sfeam <[email protected]>
Newsgroups gmane.comp.graphics.gnuplot.user
Organization gnuplot development team
Message-ID <3326271.iZnciMtLPu@stonelion>
On Wednesday, 27 February 2019 06:47:23 theozh wrote:
> with rand(0) you can generate pseudo-random numbers x in gnuplot.
> According to the manual they are in the interval [0:1]. 
> From this, I would conclude (0 <= x <= 1), i.e. 0 and 1 are included and possible values to appear, correct?

  rand(0) ∈ (0,1)

That is, the endpoints are not included in the range.
From the source code in internal.c:

/***********************************************************************
     double ranf(double init)
                Random number generator as a Function
     Returns a random floating point number from a uniform distribution
     over 0 - 1 (endpoints of this interval are not returned) using a
     large integer generator.
     This is a transcription from Pascal to Fortran of routine
     Uniform_01 from the paper
     L'Ecuyer, P. and Cote, S. "Implementing a Random Number Package
     with Splitting Facilities." ACM Transactions on Mathematical
     Software, 17:98-111 (1991)


	Ethan

_______________________________________________
gnuplot-info mailing list
[email protected]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.