Description
Is there much meaning to unsigned right shift? With arbitrary-precision integers, there's not much meaning to 'signed' and 'unsigned', as we don't have any particular need to downcast to a signed or unsigned fixed width integer, as >>
/>>>
does on Numbers. For users who want to get at a 64-bit signed/unsigned integer's right shift functionality, that can be accessed by putting the left operand within the 64-bit signed or unsigned integer range.
I see a couple viable options for the semantics of >>>
:
>>
and>>>
do the same thing>>>
throws a TypeError
My personal preference is for 2. There's no need to expose duplicate functionality under another name, and not exposing it would give us space to give it other semantics in the future if we find a need. BigInt is generally designed with generic code that works between Numbers and BigInts as an explicit non-goal, so there is no particular need to support >>>
at all.
In earlier conversation with @msaboff, we discussed the possibility of some other semantics for >>>
, but Waldemar Horwat pointed out that the bitwidth of a BigInt is not sufficiently defined to make that meaningful.