RangeEnd function

Warning

This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.

Please see https://aka.ms/qdk.api for the API documentation for the Modern QDK.

Namespace: Microsoft.Quantum.Core

Package: Microsoft.Quantum.QSharp.Foundation

Returns the defined end value of the given range, which is not necessarily the last element in the sequence.

function RangeEnd (range : Range) : Int

Input

range : Range

Input range.

Output : Int

The defined end value of the given range.

Remarks

A range expression's first element is start, its second element is start+step, third element is start+step+step, etc., until end is passed.

Note that the defined end value of a range can differ from the last element in the sequence specified by the range; for example, in a range 0 .. 2 .. 5 the last element is 4 but the end value is 5.