? INT(1000 * RAND( ) + 1)>>>>Instead of using 1000 in the equation above, use 999. The +1 could give you 1001, if RAND() returns 1 which it could.
>>>lnRandMin = 1 >>>lnRandMax = 1000 >>> >>>? INT((lnRandMax - lnRandMin) * RAND( ) + lnRandMin) >>>Correct?
lnRandMin = 1 >lnRandMax = 1000 > >? RAND((lnRandMax - lnRandMin) * RAND( ) + lnRandMin,0) >>
do while .T. rv = rand() if rv = 0.0 ? rv endif if rv = 1.0 ? rv endif enddoI've left this running for several hours now without 1 being printed but lots of 0's (VFP6), so empirically I'm not convinced - you say it does & the manual says between 0 & 1, so I will accept than as a possibility without, hence my variation using round() rather than int(), which avoids the problem.