"Sputnik" help  
Sputnik Help
BitRotateRight(<value>, <bits>, [<type>])

Description

Performs a bitwise left rotation operation on the given value and returns the result. The rotation is restricted within the specified type.

Parameters

<value> The value to perform the bitwise left rotation on.
<bits> The number of bits to rotate the value.
<type> (Optional): The type that determines the size of the value and restricts the rotation. Default value is 'q'.

Return Value

Success: Returns the result of the bitwise left rotation operation.
Failure: Returns null.

Remarks

The BitRotateLeft function performs a left rotation of the bits within the specified value by the specified number of bits. The rotation is performed within the size determined by the specified type, restricting the rotation within that size.

The available type options and their corresponding sizes are:


By default, the rotation is performed on a 64-bit value. You can specify a different type to restrict the rotation within the corresponding size.

Related

Example

Example of usage:

my $value = (Byte)0b001100;
say unpack("B*", $value, @UnpackSingle);
my $rotatedLeftValue = BitRotateLeft($value, 2, 'b');
say unpack("B*", $rotatedLeftValue, @UnpackSingle);
my $rotatedRightValue = BitRotateRight($value, 2, 'b');
say unpack("B*", $rotatedRightValue, @UnpackSingle);

// PRINTS
// 00001100
// 00110000
// 00000011

 


Contact
Cheryl (uberfox@hotmail.com)
Homepage
http://ubersoft.org