Re: Rndm

From: Pasha Murat (630)840-8237 FNAL (630)859-3463 home (murat@murat.fnal.gov)
Date: Sat Oct 30 1999 - 14:42:21 MEST


TRandom::Rndm is a _direct_  one-to-one translation into C++
of CERNLIB's RNDM. The call parameter is dummy, it has never 
been used by FORTRAN as well. It was necesary for purely technical
reasons: some old FORTRAN compilers didn't allow to write a function 
without parameters. 
					-best, Pasha.

KOSU_FOKIN@garbo.lucas.lu.se wrote:
> 
> Could you tell me what Int_t argument is for in Rndm :
> 
>  Float_t TRandom::Rndm(Int_t)
> {
> //  Machine independent random number generator.
> //  Produces uniformly-distributed floating points between 0 and 1.
> //  Identical sequence on all machines of >= 32 bits.
> //  Periodicity = 10**8
> //  Universal version (Fred james 1985).
> 
>    const Float_t kCONS = 4.6566128730774E-10;
>    const Int_t kMASK31 = 2147483647;
> 
>    fSeed *= 69069;
>       // keep only lower 31 bits
>    fSeed &= kMASK31;
>       // Set lower 8 bits to zero to assure exact float
>    Int_t jy = (fSeed/256)*256;
>    Float_t random = kCONS*jy;
>    return random;
> }
> 
> best,
> Anton



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:41 MET