Skip to main content

Rand

Rand (Function)

Format

rand
rand ( )

returns float_expression

Description

Returns a random number between 0 and 1. The distribution of the values is uniform.

Note

To produce random numbers between other values, simple multiply or add the appropriate numbers. For example, to generate an integer between 0 and 10, use int(rand * 10).

Each call to rand is unrelated to the last. When you want values that vary smoothly instead — for terrain, clouds, textures or a wandering path — use noise.

See Also

Abs, Acos, Asin, Atan, Ceil, Cos, Degrees, Exp, Float, Floor, Int, IsNumeric, Log, Log10, Noise, Radians, Rand, Round, Seed, Sin, Sqr, Tan

History