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

Description

Performs a right 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 right.

Return Value

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

Remarks

The RotateRight function performs a circular rotation on the bits of the value, shifting them to the right by the specified distance. If the value is a binary representation, the rotation is applied to the binary bits.

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