SequenceI 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.Arrays
Package: Microsoft.Quantum.Standard
Get an array of integers in a given interval.
function SequenceI (from : Int, to : Int) : Int[]
Input
from : Int
An inclusive start index of the interval.
to : Int
An inclusive end index of the interval that is not smaller than from
.
Output : Int[]
An array containing the sequence of numbers from
, from + 1
, ...,
to
.
Example
let arr1 = SequenceI(0, 3); // [0, 1, 2, 3]
let arr2 = SequenceI(23, 29); // [23, 24, 25, 26, 27, 28, 29]
let arr3 = SequenceI(-5, -2); // [-5, -4, -3, -2]
let numbers = SequenceI(0, _); // function to create sequence from 0 to `to`
let naturals = SequenceI(1, _); // function to create sequence from 1 to `to`
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for