Gigantix is a Roblox Lua module designed specifically to handle INFINITELY large numbers. It doesn’t do magic—it’s just a handler for big numbers. Whether you're dealing with trillions, quadrillions, or even beyond, Gigantix provides you with the tools to convert, format, and perform arithmetic on these massive numbers with ease.
Roblox’s native number handling can be limited when dealing with exponentially large values. Gigantix addresses this gap by offering a simple, yet powerful, set of functions to manage and operate on big numbers efficiently, ensuring your game logic remains both clear and performant.
- Handle Large Numbers: Manage numbers up to a Googolplex and beyond theorically. (I think)
- Convert Notations: Transform shorthand notations (e.g., "15K", "1.2M") into full numeric values using
notationToString
. - Format Numbers:
- Short Notation: Convert full number arrays to a compact representation with
getShort
. - Long Notation: Retrieve the complete numeric value from a shorthand string using
getLong
.
- Short Notation: Convert full number arrays to a compact representation with
- Arithmetic Operations:
- Addition: Add large numbers with
add
. - Subtraction: Subtract large numbers with
subtract
. - Multiplication: Multiply large numbers with
multiply
.
- Addition: Add large numbers with
- Encoding/Decoding:
- Encode Numbers: Get an encoded string representation using
encodeNumber
. - Decode Numbers: Convert an encoded string back to a full number with
decodeNumber
.
- Encode Numbers: Get an encoded string representation using
- Comparison Operations:
- Compare numbers using
isEquals
,isGreater
,isLesser
,isGreaterOrEquals
, andisLesserOrEquals
. - Check negativity using
isNegative
.
- Compare numbers using
- Copy the
Gigantix
module into your Roblox project and place it in ReplicatedStorage or ServerScriptService. - Include the module in your scripts using
require()
.
local Gigantix = require(ReplicatedStorage.Gigantix)
local fullNumber = Gigantix.notationToString("15K")
print("Full number from notation '15K':", fullNumber) -- Output: "15000"
-
Convert a Full Number String to a Long Number Representation
local numberArray = Gigantix.stringToNumber("15000")
-
Get Short Notation
local shortNotation = Gigantix.getShort(numberArray) print("Short notation for 15000:", shortNotation) -- Output: "15K"
-
Get Long Notation
local longNotation = Gigantix.getLong(numberArray) print("Long notation for 15000:", longNotation) -- Output: "15000"
-
Addition
local num1 = Gigantix.stringToNumber("15000") local num2 = Gigantix.stringToNumber("-5000") local sum = Gigantix.add(num1, num2) print("15000 + (-5000) =", Gigantix.getLong(sum)) -- Output: "10000"
-
Subtraction
local difference = Gigantix.subtract(num1, num2) print("15000 - (-5000) =", Gigantix.getLong(difference)) -- Output: "20000"
-
Multiplication
local product = Gigantix.multiply(num1, Gigantix.stringToNumber("-2")) print("15000 * (-2) =", Gigantix.getLong(product)) -- Output: "-30000"
local isEqual = Gigantix.isEquals(num1, {0, 15})
print("Does 15000 equal {0, 15}?", isEqual)
local isGreater = Gigantix.isGreater(num1, num2)
print("Is 15000 greater than -5000?", isGreater)
local isLesser = Gigantix.isLesser(num1, num2)
print("Is 15000 lesser than -5000?", isLesser)
-
Encoding a Number
local encoded = Gigantix.encodeNumber("1000000") print("Encoded representation of '1000000':", encoded)
-
Decoding a Number
local decoded = Gigantix.decodeNumber(encoded) print("Decoded number from", encoded, "(this returns a string):", decoded)
For issues, feature requests, contributions, or recommendations, feel free to open an issue on GitHub.
Join the discussion on the Roblox Developer Forum to stay updated and contribute to the community!