Berserk Docs
Scalar FunctionsMath Functions

rand

Return a pseudo-random real.

Zero-argument form returns a real in [0.0, 1.0); the rand(n) form returns an integer-valued real in [0, n) (matching Microsoft Kusto's return type).

Syntax

rand()

Returns: real

Syntax

rand(n)

Parameters

Prop

Type

Returns: real

Examples

Example 1

print r = rand()
| extend in_range = (r >= 0.0 and r < 1.0)
| project in_range
in_range (bool)
true

Example 2

print r = rand(100)
| extend in_range = (r >= 0.0 and r < 100.0)
| project in_range
in_range (bool)
true

On this page