_lrotl, _lrotr

旋转位左移 (_lrotl) 或右边 (_lrotr)。

unsigned long _lrotl(
   unsigned long value,
   int shift 
);
unsigned long _lrotr(
   unsigned long value,
   int shift 
);

参数


  • 将旋转的值。

  • shift
    转换 值的位的数目。

返回值

两个函数返回该旋转的值。 无错误返回。

备注

_lrotl_lrotr 功能由 shift 位旋转 _lrotl 旋转值。 _lrotr 旋转值权限。 两个包装函数位旋转 值的 一端到另一端。

要求

实例

必需的头

_lrotl

stdlib.h

_lrotr

stdlib.h

有关更多兼容性信息,请参见中介绍的 兼容性

C 运行库的所有版本。

示例

// crt_lrot.c

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

int main( void )
{
   unsigned long val = 0x0fac35791;

   printf( "0x%8.8lx rotated left eight times is 0x%8.8lx\n", 
            val, _lrotl( val, 8 ) );
   printf( "0x%8.8lx rotated right four times is 0x%8.8lx\n", 
            val, _lrotr( val, 4 ) );
}

Output

0xfac35791 rotated left eight times is 0xc35791fa
0xfac35791 rotated right four times is 0x1fac3579

.NET Framework 等效项

不适用。若要调用标准 C 函数,请使用 PInvoke。有关更多信息,请参见 平台调用示例

请参见

参考

浮点支持

_rotl, _rotl64, _rotr, _rotr64