Generation of uniformly distributed random numbers (0,1)
| int MathRand( | ) |
MathSrand(TimeLocal());
// Displays 10 numbers.
for(int i=0;i<10;i++ )
Print("random value ", MathRand());
| int MathRand( | ) |
I know that!
I'm asking about the range (0.1).
I'm sorry, if you're looking for a range.
MathSrand(TimeLocal()); // Отображает 10 чисел. for(int i=0; i<10; i++ ) Print("произвольная величина ", MathRand()/32768);
something like this.
MathSrand(TimeLocal()); ............... ............... ............... //---------------------------Непрерывный Генератор СЧ--------------------- double CRG(double min,double max) { return(min+((max-min)*MathRand()/32767.0));} //=======================================================================
where:
min - range start
max - end of range.
In your case it will be:
void Start() { MathSrand(TimeLocal()); ............... ............... ............... double p=CRG(0.0,1.0); } //---------------------------Непрерывный Генератор СЧ--------------------- double CRG(double min,double max) { return(min+((max-min)*MathRand()/32767.0));} //=======================================================================
if so,
double ran= MathRand()/32768.;then between n/32768. and n+1/32768. at n e Z & n e [0.32767] is empty. This is not good.
if so,
then between n/32768. and n+1/32768. with n e Z & n e [0.32767] is empty. This is not good.Do you know, dear fellow, that there is an infinite number of real numbers between any real numbers, however close to each other?
And do you know that the interval (0,1) is equivalent to an infinite line in power?
If no - think about it.
If yes - formulate your question correctly.
At the same time try to say at what density (pieces per unit length) do you want to have a MF generation ?
Or maybe you want your GSF to generate all numbers a segment of (0,1) ?
Generation of uniformly distributed random numbers (0,1) by MQL tools without external *.dll?