Chinaunix首页 | 论坛 | 博客
  • 博客访问: 96227
  • 博文数量: 13
  • 博客积分: 1404
  • 博客等级: 上尉
  • 技术积分: 145
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-01 12:51
文章分类

全部博文(13)

文章存档

2014年(4)

2013年(3)

2012年(3)

2011年(1)

2009年(2)

我的朋友

发布时间:2014-06-21 16:59:56

Reversing the bits in an integer x is somewhat painful, but here's a SWAR algorithm for a 32-bit value:unsigned intreverse(register unsigned int x){x = (((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << 1));x = (((x & 0xcccccccc) >> 2) | ((x & 0x33333333) << 2));x = (((x & 0xf0f0f.........【阅读全文】

阅读(1985) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册