mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Improve description of bit32.replace.
Fix description of w parameter, indicate that index is 0-based, and indicate that selected range causes an error if out of bounds.
This commit is contained in:
parent
5d54a2218a
commit
75dbcf913f
1 changed files with 1 additions and 1 deletions
|
@ -701,7 +701,7 @@ Shifts `n` to the left by `i` bits (if `i` is negative, a right shift is perform
|
|||
function bit32.replace(n: number, r: number, f: number, w: number?): number
|
||||
```
|
||||
|
||||
Replaces bits at positions `[f..w]` of number `n` with `r` and returns the resulting integer. `w` defaults to `f+1`, so a three-argument version of `replace` changes one bit at position `f` to `r` (which should be 0 or 1) and returns the result.
|
||||
Replaces bits of `n` at position `f` and width `w` with `r`, and returns the resulting integer. `w` defaults to `1`, so a three-argument version of `replace` changes one bit at position `f` to `r` (which should be 0 or 1) and returns the result. Bits are indexed starting at 0. Errors if `f` and `f+w-1` are not between 0 and 31.
|
||||
|
||||
```
|
||||
function bit32.rrotate(n: number, i: number): number
|
||||
|
|
Loading…
Add table
Reference in a new issue