btest and minmax alias

This commit is contained in:
2024-04-24 15:24:06 -04:00
parent c6907291b4
commit d77778ed7d

View File

@@ -30,19 +30,22 @@ export type Math = {
IsEven: (n: number) -> boolean,
RotationMatrix: (X: number, Y: number, Z: number) -> RotationMatrix,
Scalar: (X1: number, Y1: number, X2: number, Y2: number) -> Scalar,
maxmin: (min: number, n: number, max: number) -> number
maxmin: (min: number, n: number, max: number) -> number,
minmax: (min: number, n: number, max: number) -> number
}
local Math = {} :: Math
function Math.IsEven(n)
return bit32.band(n, 1) == 0
return bit32.btest(bit32.band(n, 1))
end
function Math.maxmin(min, n, max)
return math.max(min, math.min(n, max))
end
Math.minmax = Math.maxmin
function Math.RotationMatrix(X: number, Y: number, Z: number): RotationMatrix
local cosX, sinX = math.cos(X), math.sin(X)
local cosY, sinY = math.cos(Y), math.sin(Y)