[Previous]
[Contents]
[Next]

_rotl()

rotate an unsigned integer to the left

Synopsis:

#include <stdlib.h>
unsigned int _rotl( unsigned int value,
                    unsigned int shift );

Description:

The _rotl() function rotates the unsigned integer, value, to the left by the number of bits specified in shift. If you port an application using _rotl() between a 16-bit and a 32-bit environment, you'll get different results because of the difference in the size of integers.

Returns:

The rotated value.

Examples:

#include <stdio.h>
#include <stdlib.h>

unsigned int mask = 0x0F00;

void main()
  {
    mask = _rotl( mask, 4 );
    printf( "%04X\n", mask );
  }

produces the output:

F000

Classification:

WATCOM

Safety:
Interrupt handler Yes
Signal handler Yes
Thread Yes

See also:

_lrotl(), _lrotr(), _rotr()


[Previous]
[Contents]
[Next]