The start of the sequence. If end is not provided, this value is treated as end, and start defaults to 0 or 0n.
Optionalend: numberThe end of the sequence (exclusive).
Optionalstep: numberThe increment between numbers. Defaults to 1 (or 1n).
A Generator that yields numbers in the specified range.
Warning on Floating-Point Numbers:
While this function accepts floating-point numbers for start, end, and step,
their use can lead to unexpected behavior due to the inherent imprecision of
floating-point arithmetic. Accumulating a fractional step may result in values
that are slightly off, potentially causing the sequence to include an extra
element or miss the last one. For predictable and reliable sequences, it is
strongly recommended to use integers.
Creates a generator that yields a sequence of numbers or bigints.
This function behaves similarly to Python's range(). It's lazy, returning a
Generator that produces values on demand. The end value is exclusive.
It can be called in three ways:
range(end): Creates a sequence from 0 up to (but not including) end.range(start, end): Creates a sequence from start up to (but not including) end.range(start, end, step): Creates a sequence from start with a given step.The default step is always 1 (or 1n). To count down, an explicit negative step must be provided.
The start of the sequence. If end is not provided, this value is treated as end, and start defaults to 0 or 0n.
Optionalend: bigintThe end of the sequence (exclusive).
Optionalstep: bigintThe increment between numbers. Defaults to 1 (or 1n).
A Generator that yields numbers in the specified range.
Warning on Floating-Point Numbers:
While this function accepts floating-point numbers for start, end, and step,
their use can lead to unexpected behavior due to the inherent imprecision of
floating-point arithmetic. Accumulating a fractional step may result in values
that are slightly off, potentially causing the sequence to include an extra
element or miss the last one. For predictable and reliable sequences, it is
strongly recommended to use integers.
Creates a generator that yields a sequence of numbers or bigints.
This function behaves similarly to Python's
range(). It's lazy, returning aGeneratorthat produces values on demand. Theendvalue is exclusive.It can be called in three ways:
range(end): Creates a sequence from0up to (but not including)end.range(start, end): Creates a sequence fromstartup to (but not including)end.range(start, end, step): Creates a sequence fromstartwith a givenstep.The default step is always
1(or1n). To count down, an explicit negative step must be provided.