Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RAND() value range
Message
 
To
04/12/1998 14:44:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00164229
Message ID:
00164253
Views:
19
I ran a test where I did 10,000,000 RANDs. The min. and max. I got were 0.00000001513399 and 0.99999959790148. Of course, I can't prove that it will never return 0 or 1, but I suspect that it won't. Of course, if you're generating an integer you'll probably end up rounding to the equivalent of 0 or 1 anyway.

>VFP help says that RAND() returns a random number between 0 and 1.
>
>I always thought that the allowable return value range included 0, but did not include 1 (although it could get as close as it wants to unity).
>
>The help definition seems to include both 0 and 1 (inclusive), or exclude both 0 and 1 (exclusive). Do we have an unambiguous definition somewhere?
>
>Bob
Previous
Reply
Map
View

Click here to load this message in the networking platform