"Sputnik" help  
Sputnik Help
RotateLeft(<value>, <distance>)

Description

Performs a left rotation on a value by a specified distance.

Parameters

<value> The value to be rotated.
<distance> The number of positions to rotate the value to the left.

Return Value

Success: Returns the rotated value.
Failure: Returns null.

Remarks

The RotateLeft function performs a circular rotation on the bits of the value, shifting them to the left by the specified distance. The internal implementation of the function uses bitwise operations to achieve the rotation.

Related

Example

Example of usage:

my $value = (Byte)0b00011000;
my $left = RotateLeft($value, 2);
my $right = RotateRight($value, 2);
say unpack("B*", $value, @UnpackSingle);
say unpack("B*", $left, @UnpackSingle);
say unpack("B*", $right, @UnpackSingle);

// PRINTS
// 00011000
// 01100000
// 00000110

 


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