Skip to content

@technobuddha > library > Binary > Arithmetic

Function: rotr()

ts
function rotr(num: number, bits: number): number;

Defined in: rotr.ts:10

Rotates the bits of a 32-bit number to the right by a specified number of bits.

Parameters

ParameterTypeDescription
numnumberThe 32-bit integer to rotate.
bitsnumberThe number of bits to rotate to the right.

Returns

number

The result of rotating num to the right by bits positions as an unsigned 32-bit integer.