Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RAND() value range
Message
 
À
04/12/1998 14:44:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00164229
Message ID:
00164253
Vues:
26
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform