Skip to content

shiftRightUnsigned64

shiftRightUnsigned64(value, count): bigint

Defined in: packages/core/src/big-int/bit/shift-right-unsigned64.ts:17

Logical right shift of the low 64 bits — JavaScript’s missing >>> for bigint, which only has the sign-propagating >>.

The value is taken as an unsigned 64-bit word first, so a negative operand shifts in zeros from its two’s complement pattern rather than ones. A shift of 64 or more clears the word, matching what a 64-bit machine instruction would leave behind rather than C’s undefined behaviour.

bigint

The word to shift; only its low 64 bits are considered.

number

Bit positions to shift by. Zero or less returns the word unchanged apart from the masking.

bigint

The shifted word, always non-negative.