random float

For random.

Generate a random float within a range [min..max].

Command Type

built-in

Signature

> random float {flags} (range)

Parameters

  • range: Range of values.

Input/output types:

input output
nothing float

Examples

Generate a default float value between 0 and 1.

> random float

Generate a random float less than or equal to 500.

> random float ..500

Generate a random float greater than or equal to 100000.

> random float 100000..

Generate a random float between 1.0 and 1.1.

> random float 1.0..1.1

Ported from nushell/nushell.github.io. Copyright (c) 2021 Nushell Project. MIT License.