Runtime v2.81 · Updated Sep 30, 2026

random

Return a random floating-point number in the 0 -> 1 range.

Syntax

random()

Parameters

None

Returns

Float — Random floating-point value in 0 -> 1 (1 is exclusive).

Behavior / side effects

Return a random floating-point number in the 0 -> 1 range.

Execution

  • Blocking: Conditional
  • Thread safety: Not guaranteed
  • Parallel execution: Conditional

Execution cost and waits depend on the documented operation. Keep mutable values in their owning flow; sharing arbitrary objects between flows has no general thread-safety guarantee.

Example

chance = random()
if chance < 0.25:
    text("lucky")

Errors / limitations

No additional limitations documented; follow the parameter and behavior contract above.

Related APIs

None