Skip to main content

RANGE

Constant RANGE 

Source
pub const RANGE: FunctionDescriptor;
Expand description

Creates a bounded sequence of exactly representable integer Numbers from start inclusive to end exclusive.

Each bound must be finite, integral, and exactly representable from -9007199254740991 through 9007199254740991. End is exclusive; descending bounds produce an empty list. Invalid endpoints return DataError; a host resource limit remains a Diagnostic.

§Signature

func range(end: Number) -> Res[List[Number], DataError]
func range(start: Number, end: Number) -> Res[List[Number], DataError]

§Range from zero

One bound starts at zero.

print(range(3)?.len());

§Range with bounds

The start is inclusive and end is exclusive.

print(range(2, 5)?.len());