summaryrefslogtreecommitdiff
path: root/locale/zh-CN/libs/@lua/bit32.lni
blob: 35aa22cc5dab6d9058d9bbf393ddc4e2d9b9c8c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
[arshift]
description = [[
返回 `x` 向右位移 `disp` 位的结果。`disp` 为负时向左位移。这是算数位移操作,左侧的空位使用 `x` 的高位填充,右侧空位使用 `0` 填充。
]]

[band]
description = '返回参数按位与的结果。'

[bnot]
description = [[
返回 `x` 按位取反的结果。

```lua
assert(bit32.bnot(x) == (-1 - x) % 2^32)
```
]]

[bor]
description = '返回参数按位或的结果。'

[btest]
description = '参数按位与的结果不为0时,返回 `true` 。'

[bxor]
description = '返回参数按位异或的结果。'

[extract]
description = '返回 `n` 中第 `field` 到第 `field + width - 1` 位组成的结果。'

[replace]
description = '返回 `v` 的第 `field` 到第 `field + width - 1` 位替换 `n` 的对应位后的结果。'

[lrotate]
description = '返回 `x` 向左旋转 `disp` 位的结果。`disp` 为负时向右旋转。'

[lshift]
description = [[
返回 `x` 向左位移 `disp` 位的结果。`disp` 为负时向右位移。空位总是使用 `0` 填充。

```lua
assert(bit32.lshift(b, disp) == (b * 2^disp) % 2^32)
```
]]

[rrotate]
description = '返回 `x` 向右旋转 `disp` 位的结果。`disp` 为负时向左旋转。'

[rshift]
description = [[
返回 `x` 向右位移 `disp` 位的结果。`disp` 为负时向左位移。空位总是使用 `0` 填充。

```lua
assert(bit32.lshift(b, disp) == (b * 2^disp) % 2^32)
```
]]