tuple_gen_sequencetuple_gen_sequenceTupleGenSequenceTupleGenSequencetuple_gen_sequence (Operator)

Name

tuple_gen_sequencetuple_gen_sequenceTupleGenSequenceTupleGenSequencetuple_gen_sequence — Generate a tuple with a sequence of equidistant values.

Signature

tuple_gen_sequence( : : Start, End, Step : Sequence)

Herror tuple_gen_sequence(const Hlong Start, const Hlong End, const Hlong Step, Hlong* Sequence)

Herror T_tuple_gen_sequence(const Htuple Start, const Htuple End, const Htuple Step, Htuple* Sequence)

void TupleGenSequence(const HTuple& Start, const HTuple& End, const HTuple& Step, HTuple* Sequence)

static HTuple HTuple::TupleGenSequence(const HTuple& Start, const HTuple& End, const HTuple& Step)

static void HOperatorSet.TupleGenSequence(HTuple start, HTuple end, HTuple step, out HTuple sequence)

static HTuple HTuple.TupleGenSequence(HTuple start, HTuple end, HTuple step)

def tuple_gen_sequence(start: Union[float, int], end: Union[float, int], step: Union[float, int]) -> Sequence[Union[float, int]]

def tuple_gen_sequence_s(start: Union[float, int], end: Union[float, int], step: Union[float, int]) -> Union[float, int]

Description

tuple_gen_sequencetuple_gen_sequenceTupleGenSequenceTupleGenSequencetuple_gen_sequence generates a new tuple SequenceSequenceSequencesequencesequence with a sequence of equidistant values:

[Start, Start + Step, Start + 2*Step, ... End]

StepStepStepstepstep must not be zero and the sign of (EndEndEndendend - StartStartStartstartstart) must be equal to the sign of StepStepStepstepstep. The last entry of SequenceSequenceSequencesequencesequence may actually be less than EndEndEndendend, if (EndEndEndendend - StartStartStartstartstart) is not divisible by StepStepStepstepstep without remainder.

Exception: Empty input tuples

If any of the input tuples is empty, an exception is raised.

HDevelop In-line Operation

HDevelop provides an in-line operation for tuple_gen_sequencetuple_gen_sequenceTupleGenSequenceTupleGenSequencetuple_gen_sequence, which can be used in an expression in the following syntax:

Sequence := [Start:Step:End]

An alternative syntax is Sequence := [Start:End], where StepStepStepstepstep defaults to 1.

Execution Information

Parameters

StartStartStartstartstart (input_control)  number HTupleUnion[float, int]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Start value of the tuple.

EndEndEndendend (input_control)  number HTupleUnion[float, int]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Maximum value for the last entry.

StepStepStepstepstep (input_control)  number HTupleUnion[float, int]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Increment value.

SequenceSequenceSequencesequencesequence (output_control)  number(-array) HTupleSequence[Union[float, int]]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

The resulting sequence.

Alternatives

tuple_str_bit_selecttuple_str_bit_selectTupleStrBitSelectTupleStrBitSelecttuple_str_bit_select, tuple_selecttuple_selectTupleSelectTupleSelecttuple_select, tuple_str_first_ntuple_str_first_nTupleStrFirstNTupleStrFirstNtuple_str_first_n, tuple_str_last_ntuple_str_last_nTupleStrLastNTupleStrLastNtuple_str_last_n, tuple_concattuple_concatTupleConcatTupleConcattuple_concat, tuple_inserttuple_insertTupleInsertTupleInserttuple_insert, tuple_replacetuple_replaceTupleReplaceTupleReplacetuple_replace, tuple_gen_consttuple_gen_constTupleGenConstTupleGenConsttuple_gen_const

See also

tuple_randtuple_randTupleRandTupleRandtuple_rand

Module

Foundation