next up previous contents index
Next: 20.5 Some mathematical-support related Up: 20. Mathematical Support Previous: 20.3 Integrals

20.4 ns-random

ns-random is an obsolete way to generate random numbers. This information is provided only for backward compatibility.

ns-random is implemented in misc.{cc,h}. When called with no argument, it generates a random number with uniform distribution between 0 and MAXINT. When an integer argument is provided, it seeds the random generater with the given number. A special case is when ns-random 0 is called, it randomly seeds the generator based on current time. This feature is useful to produce non-deterministic results across runs.