Gigantix is a powerful Roblox Lua module designed to handle extremely large numbers seamlessly. Whether you’re dealing with trillions, quadrillions, or beyond (theoretically can be infinite if we get infinite computer power), Gigantix provides tools to convert, format, add, and subtract massive numbers with precision and almost no overhead. Keep in mind this module was created by a beginner in Roblox Scripting, so there may be some knowledge gaps and further improvements to this module.
PS: If you are using this module, please tell me, this motivates me to keep developing and supporting my first ever module .
Installation
As of right now, you can install Gigantix only by going to my Github and downloading the Gigantix.lua file or by just copying the code.
Further contact
You can contact me directly under this Topic or on my Twitter DM’s.
License
This project is under the MIT license! So, it’s open source. But if you are using this module, please tell me, this motivates me to keep developing and supporting my first ever module .
Thank you for commenting, I don’t think you understood the concept of the module, roblox have a precise number. But what I mean here is: basically the integer of most languages if not all, have a limit, on Roblox is around 9.2 quintillion. But well, how would simulators and other games have numbers above that number? You can do by a lot of means, but some of them dont give a precision (this is what I mean), for example, u could have like 100.000.000.000.000.001 and when u joined again it would probably have changed to 100.000.000.000.000.000.
In this module that doesn’t happens, because I use a array-based representation, where each digit is saved, even when adding or subtracting, once the logic is like you doing it on the paper.
Yes, you are right! But by the comment I thought u didn’t understand. Than you are in the right place!
The module by default handles up to Googolplex, most people will never need that much! If you end up using on a game please link it to me! Also if you find any bug or feature missing just comment here that I will add and fix whenever is possible.
I would have thought this is in Roblox to begin with, but a while ago, I tried to find a way and the answer I got was no. So I’ll will be using this in future projects. (I currently don’t have a project to put this in)
OHHH I need that for my simulator games because rebirthing in my game gives 5x boost, after like 10 rebirths u have 50x boost, then the player gets so much money roblox just stops giving money and it becomes like a negative number.
(ill let u know the game when my simulator is done)
(also when i said unprecise i meant like at very high numbers)
Could you elaborate more? I don’t think storing each digit in an array is performant, especially as you go higher.
And what makes this different from say, InfiniteMath or BigNumber
Edit: I’ve looked at your code and It seems like you do rely on purely arrays, InfiniteMath among others I believe uses the IEEE 754 format to store their big numbers. May I suggest that you try other approaches, or if you want to still settle on an array-ish approach, try buffers
Hello Artzified, thank you for your comment and pointing out a few modules I didn’t know about. You are right, in terms of performance arrays aren’t the best, however I will explain why I chose to use arrays.
Arrays give a possibility to grow indefinitely (given unlimited computer power), and that is the point of my module, while InfiniteMath seems to have a max number (using IEEE), my module don’t have a limit, even if it might take performance as a cost. Meanwhile BigNumber also seems to have a limit, once it uses a Radix Base aproach, unlike my module. But you are right, I should change my aproach to solve this problem, once an array consumes a lot of memory.
About your concern and suggestion about IEEE 754, it shows the same issue of not being able to grow without a limit. I was thinking of implementing buffers or change my aproach to a aritrary precision whenever I have the time. I am open to more suggestions of how to implement a infinite growing number or how to improve it performance wise.
Also I would like to highlight some features of my module that the others don’t seem to have:
Able to add new “number types” like “K to represent 1000”, you can dynamically change the value and add new ones.
Able to use the same “number types” to create new longNumbers like 10K to create 10000
That’s some interesting insights, It’s a unique approach for sure. I honestly want to optimize your resource with buffers, as they’re way more memory efficient compared to tables. I might make a PR when I got the time.
Perfect, glad you think so! It would help me a lot since I still got exams to do this year and still got to learn about buffers before implementing it!
Hey, I just noticed that your module seems to lack the support for floating point numbers? Or that I don’t know how to use it properly, either way I looked at the logic behind the conversion and it seems like it doesn’t account for decimals?