rotate an unsigned long integer to the right
#include <stdlib.h> unsigned long _lrotr( unsigned long value, unsigned int shift );
The _lrotr() function rotates the unsigned long integer, determined by value, to the right by the number of bits specified in shift.
The rotated value.
#include <stdio.h> #include <stdlib.h> unsigned long mask = 0x12345678; void main() { mask = _lrotr( mask, 4 ); printf( "%08lX\n", mask ); }
produces the output:
81234567
WATCOM
Safety: | |
---|---|
Interrupt handler | Yes |
Signal handler | Yes |
Thread | Yes |