Skip to content

Commit

Permalink
Add bit32.byteswap (#1267)
Browse files Browse the repository at this point in the history
https://luau-lang.org/library#bit32-library (doesn't have a creator-docs
description)
  • Loading branch information
rimuy authored Aug 7, 2024
1 parent fc8f671 commit 729f540
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/lua.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,9 @@ declare namespace bit32 {
/** Returns the number of consecutive zero bits in the 32-bit representation of the provided number starting from the right-most (least significant) bit. */
function countrz(n: number): number;

/** Returns `n` with the order of the bytes swapped. */
function byteswap(n: number): number;

/**
* Returns the unsigned number formed by the bits `field` to `field + width - 1` from `n`.
* Bits are numbered from 0 (least significant) to 31 (most significant).
Expand Down

0 comments on commit 729f540

Please sign in to comment.