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

Description

Performs a bitwise right 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 right 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 right rotation operation.
Failure: Returns false.

Remarks

The BitRotateRight function performs a right 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