-
-
Notifications
You must be signed in to change notification settings - Fork 2
Module: Bitwise
albion edited this page Jun 6, 2025
·
2 revisions
Important
Documentation has moved to the docs. This wiki will no longer be updated, and may be deleted in the future.
local Bitwise = require("Starlit/utils/Bitwise")The Bitwise module defines some bitwise operations helper functions. These are generally faster than other implementations I've come across.
Bitwise.get(int: integer, pos: integer) -> bit: booleanChecks the value of a single bit within an integer. pos is the position of the bit, counting from the right, starting with 1.
Bitwise.set(int: integer, pos: integer, value: boolean) -> int: integerReturns the passed integer int modified with the specified bit changed. pos is the position of the bit, counting from the right, starting with 1.