-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Type of issue
Missing information
Feedback
The range operator can be used to represent an array of sequential integers
While true, it would should be noted that the endpoints must be (convertible to) [int32] numbers, specifically, i.e. 32-bit signed integers. Larger integer values cause an error.
For instance, the following fail:
1..([uint32]::MaxValue)
1gb..1tb # 1tb is [int64]Additionally, the count of resulting numbers is limited to:
-
[int]::MaxValue - 56(2147483591) when the result is captured in an array, as implicitly happens as part of an expression; this is due to the fact that said number is the max. count of elements in a .NET array -
in streaming processing, where the numbers are created and consumed on demand, one by one, the only thing that matters is whether the endpoints fit into
[int], which makes the effective limit on the element count[uint]::MaxValue + 1(4294967296)
Page URL
Content source URL
Author
Document Id
1ef1d966-3ba7-77aa-abb2-fb255d08da46