Chinaunix首页 | 论坛 | 博客
  • 博客访问: 528444
  • 博文数量: 118
  • 博客积分: 3995
  • 博客等级: 中校
  • 技术积分: 1276
  • 用 户 组: 普通用户
  • 注册时间: 2005-11-15 12:15
文章分类

全部博文(118)

文章存档

2014年(1)

2013年(1)

2010年(6)

2009年(27)

2008年(10)

2007年(33)

2006年(38)

2005年(2)

我的朋友

分类: LINUX

2008-05-19 14:28:05

我的系统的awk指向mawk,想使用位运算,提示没有这类内置函数;在man手册里确实没有发现它提供内置的位运算函数
装上gawk后,在其man手册里找到了位运算内置函数的相关介绍,它提供位运算操作
 
 

Bit Manipulations Functions
Starting with version 3.1 of gawk, the following bit manipulation func-
tions are available. They work by converting double-precision floating
point values to unsigned long integers, doing the operation, and then
converting the result back to floating point. The functions are:

and(v1, v2) Return the bitwise AND of the values provided by v1
and v2.

compl(val) Return the bitwise complement of val.

lshift(val, count) Return the value of val, shifted left by count
bits.

or(v1, v2) Return the bitwise OR of the values provided by v1
and v2.

rshift(val, count) Return the value of val, shifted right by count
bits.

xor(v1, v2) Return the bitwise XOR of the values provided by v1
and v2.


阅读(2164) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~