qdk icon indicating copy to clipboard operation
qdk copied to clipboard

BigInt ranges

Open bamarsha opened this issue 2 years ago • 2 comments

From microsoft/qsharp-language#132:

I'd like to be able to write this:

for k in 0L..15L {
    ...
}

Currently this causes a compile error:

error QS0001: The type Int does not match the type BigInt

It should instead be equivalent to:

for k_helper in 0..15 {
    let k = IntAsBigInt(k_helper);
    ...
}

bamarsha avatar Jul 20 '23 18:07 bamarsha

It could make sense to approach this issue by implementing generic UDTs, making ranges generic, and then re-implementing Int ranges, as well as BigInt ranges, in that new Range type.

sezna avatar Aug 07 '23 21:08 sezna

Want to nudge this issue as it was mentioned in the call yesterday.

nirajvenkat avatar May 09 '24 05:05 nirajvenkat