Rand
- Last UpdatedJan 11, 2023
- 1 minute read
- PI System
- PI Server 2018
- PI Server
Return a random number between 0 and 1. For specified x and y values, return a random number between x - y/2 and x + y/2.
Syntax
Rand(x, y)
Arguments
-
x
A real number specifying the center point of the range
-
y
A real number specifying the size of the range.
If no arguments are specified, the default range is from 0 to 1.
Returns
A random number between 0 and 1. For specified x and y values, returns a random number between x- y/2 and x + y/2.
Exceptions
None
Example
-
Rand()
-
Rand(500, 250)