Random/developers

From Wiring

Jump to: navigation, search
This page is intended as a reference for core developers only, and the content is only changed after a consensus has been reached through discussion of any such changes. Please use the Discussion page to talk about any changes or issues you have with the current implementation.
random()
Classification Math Methods
Suggested location WMath.h
C++ required No
Timing constraints None
Version introduced 1.0 (0100)
Framework dependencies None
Prototype(s)
int32_t random(int32_t howsmall, int32_t howbig)
Required? Yes
Issues None


Contents

Description

Generates random numbers.

Black Box Input

The smallest and biggest values are provided.

Black Box Output

A random float between the smallest and the biggest value is return.

Overloading

None. Single signature only.

Notes

Each time the random() function is called, it returns an unexpected value within the specified range. If one parameter is passed to the function it will return a float between zero and the value of the parameter. The function call random(5) returns values between 0 and 5. If two parameters are passed, it will return a float with a value between the the parameters.

Proposed Changes

Personal tools