diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-04-05 18:57:03 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-04-05 18:57:03 +0800 |
commit | 8cd1514556324eabcf1b96954afe53adfc2030b7 (patch) | |
tree | c9a8aa5f1f9913ea9bcde9f60de526732b679516 /server/locale/en-US/libs/lua | |
parent | 4f94d3500d6d7b6d082647359011d2ca103741db (diff) | |
download | lua-language-server-8cd1514556324eabcf1b96954afe53adfc2030b7.zip |
Lua 5.2 的API
Diffstat (limited to 'server/locale/en-US/libs/lua')
-rw-r--r-- | server/locale/en-US/libs/lua/bit32.lni | 57 | ||||
-rw-r--r-- | server/locale/en-US/libs/lua/math.lni | 6 |
2 files changed, 63 insertions, 0 deletions
diff --git a/server/locale/en-US/libs/lua/bit32.lni b/server/locale/en-US/libs/lua/bit32.lni new file mode 100644 index 00000000..13630970 --- /dev/null +++ b/server/locale/en-US/libs/lua/bit32.lni @@ -0,0 +1,57 @@ +[arshift] +description = [[ +Returns the number `x` shifted `disp` bits to the right. Negative displacements shift to the left. + +This shift operation is what is called arithmetic shift. Vacant bits on the left are filled with copies of the higher bit of `x`; vacant bits on the right are filled with zeros. +]] + +[band] +description = 'Returns the bitwise *and* of its operands.' + +[bnot] +description = [[ +Returns the bitwise negation of `x`. + +```lua +assert(bit32.bnot(x) == (-1 - x) % 2^32) +``` +]] + +[bor] +description = 'Returns the bitwise *or* of its operands.' + +[btest] +description = 'Returns a boolean signaling whether the bitwise *and* of its operands is different from zero.' + +[bxor] +description = 'Returns the bitwise *exclusive or* of its operands.' + +[extract] +description = 'Returns the unsigned number formed by the bits `field` to `field + width - 1` from `n`.' + +[replace] +description = 'Returns a copy of `n` with the bits `field` to `field + width - 1` replaced by the value `v` .' + +[lrotate] +description = 'Returns the number `x` rotated `disp` bits to the left. Negative displacements rotate to the right.' + +[lshift] +description = [[ +Returns the number `x` shifted `disp` bits to the left. Negative displacements shift to the right. In any direction, vacant bits are filled with zeros. + +```lua +assert(bit32.lshift(b, disp) == (b * 2^disp) % 2^32) +``` +]] + +[rrotate] +description = 'Returns the number `x` rotated `disp` bits to the right. Negative displacements rotate to the left.' + +[rshift] +description = [[ +Returns the number `x` shifted `disp` bits to the right. Negative displacements shift to the left. In any direction, vacant bits are filled with zeros. + +```lua +assert(bit32.rshift(b, disp) == math.floor(b % 2^32 / 2^disp)) +``` +]] diff --git a/server/locale/en-US/libs/lua/math.lni b/server/locale/en-US/libs/lua/math.lni index c731511b..0a89176e 100644 --- a/server/locale/en-US/libs/lua/math.lni +++ b/server/locale/en-US/libs/lua/math.lni @@ -37,12 +37,18 @@ description = 'Returns the largest integral value smaller than or equal to `x`.' [fmod] description = 'Returns the remainder of the division of `x` by `y` that rounds the quotient towards zero.' +[frexp] +description = 'Decompose `x` into tails and exponents. Returns `m` and `e` such that `x = m * (2 ^ e)`, `e` is an integer and the absolute value of `m` is in the range [0.5, 1) (or zero when `x` is zero).' + [huge] description = 'A value larger than any other numeric value.' [log] description = 'Returns the logarithm of `x` in the given base.' +[ldexp] +description = 'Returns `m * (2 ^ e)` .' + [max] description = 'Returns the argument with the maximum value, according to the Lua operator `<`.' |