nstcl  >  Documentation  >  nstcl-misc  >  ns_rand

Tcl Powered!

ns_rand

NAME

ns_rand — Generate a random number

SYNOPSIS

package require nstcl-misc ?1.0?
package require nstcl ?1.0?

::nstcl::ns_rand ?max?

DESCRIPTION

This function generates a random number. If max is not specified the number returned will be a floating point number with a value of 0.0 to 1.0 inclusive. If max is specified, the return value will be an integer in the range of 0 to one less than max. max must be a natural number no larger than 2147483647.

KEYWORDS

misc, nstcl