AT&T Home | AT&T Labs | Research
AT&T Labs, Inc. - Research

The Yoix® Scripting Language

Home | What's New | Grammar | Documentation | Download | License | YChart | YDAT | YWAIT | Byzgraf | FAQs
random () yoix.math
 
Returns a pseudo-random number between 0.0 and 1.0. The first call sets the seed using the current time in milliseconds and there is currently no way to reset that seed.
 
 Example:   The program
import yoix.math.*;
import yoix.stdio.*;

int  n;

for (n = 0; n < 10; n++)
    printf("%d\n", 100*random());
prints a sequence of 10 pseudo-random integers that lie between 0 and 100 on standard output. The sequence changes each time you run the program because the seed is automatically set using the current time.
 
 Return:   double
 
 See Also:   currentTimeMillis

 

Yoix is a registered trademark of AT&T Inc.