[futurebasic] Re: [FB] real RND ?

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2001 : Group Archive : Group : All Groups

From: Alain Pastor <apastor@...>
Date: Mon, 23 Apr 2001 15:07:33 +0200

Marc Girondot wrote:
> 
> >  >I try to obtain random number between 0 and 1.
> >>In the manual, it is indicated that an integer between 1 and
> >>1073741823 can be obtained using:
> >>K&=((rnd(65536)-1)<<15)+rnd(32767)
> >
> >
> >Your information (from Release 3?) is wrong. From the Release 4 Reference
> >Manual:
> 
> It is from the release 4 french manual...
> 
> >"To get a random long integer in the range 1 through 2,147,483,647, use
> >this  statement:
> >randomInteger& = ((RND(65536) - 1)<<15) + RND(32767)"
> >
>
The original US Reference Manual that I got from Staz is also
different from all the above, it reads:

To get a random long integer in the range 1 through 1,073,741,823,
use this statement:
randomInteger& = (RND(32767)<<15) + RND(32767)

(same statement in the latest e-doc file)

It is likely that I have read somewhere the change but failed to
update the range of the generated values.
Will fix the French manual for the next release.


-- 

Cheers

Alain

-----------------------------------------------------
FB^3 in Europe:  http://euro.futurebasic.com/
FB II Pouch:     http://www.pixmix.com/FB/outils.html
-----------------------------------------------------