bitwise_rol
bits = 12345; // 12345 ( 0011 000000111001 )
rol = bitwise_rol(bits, 4, 16); // 915 ( 000000111001 0011 )
- bitwise_rol(n,count,size)
- Returns the given number rotated to the left by given number of bits.
COPY/// bitwise_rol(n,count,size)
//
// Returns the given number rotated to
// the left by given number of bits.
//
// n number to be rotated left
// count number of bits to rotate
// size size of number in bits
//
/// gmlscripts.pro/license
{
var n, count, size;
n = argument0;
count = argument1;
size = argument2;
return ((n << count) & (1 << size)-1) | (n >> (size - count));
}
Contributors: EyeGuy
GitHub: View · Commits · Blame · Raw