KingNumber Module! A new module for handling numbers past 1.8E+308!

Installation

Firstly, you have to download it here. This module is perfect for working with massive numbers!

Usage

To create a KingNumber, you have to call the “.New” function, inside of the parameters is either a string or a number. The string can be either something like “100” or “1e+2” which means the same thing! You can use it normally like any normal number with most operators, however, being that this is experimental, it doesn’t support Modulus and Exponents yet. But it can be converted to a string, multiplied, divided, subtracted, and added with another KingNumber!

Extras

It can also be used to abbreviate, showing up to 1e+3,000,003 before converting back to normal form, it is on by default, but can be disabled by changing the configuration to “Science”!

Summary

A module that can allow you to display and operate on massive numbers that Roblox would normally not be able to. Will receive updates in order to ensure that it works fully well! Be sure to report bugs!

Plans

I’m using the module myself and I have already realized something. It can’t compare numbers! Oh no! Fortunately, it shouldn’t be too hard for me!

1 Like

I can’t think of a use case for this. Did you have one in mind when creating this module?

How do you store your numbers? On the model, it says:

Can support up to 9 followed by 65.536K zeroes before suffering from the string limit!

So I’m wondering how you hit the string limit, and how that might affect performance.
I’ve made a system like this before, and had a max of about 1 * 10 ^(1 * 10^308) or 1 with 1 Centillion zeros, yes 1 Centillion. I’ve tested it before and because of the method I use there is no lag at these incredibly high numbers.

Also, do you plan to add compact notation as apposed to scientific notation or just normal numbers? Compact having suffixes like 10k or 123.321M.

Well, games like Miners Haven have suffered from the 1.8e+308 limit, although they themselves are finding ways to surpass that themselves!

1 Like

I simply let the zero’s flood after the exponent, but I have plans on increasing that by converting higher numbers to Hyper-E notation, once I do some research of course!

Might help or might not, but the way I did it was I stored the first part and second part of the number in scientific notation as a string, so 1e+100 would be “1, 100”. that way, the max number of zeros is 1.8e+308, “1, 1.8+308”.

It makes it a bit harder to do the math since you have to do it in scientific notation, but once you finish it it works basically the same as regular math, since you’re just doing math with normal numbers still.

I do it like that, but strings can’t go on forever!

Wait, you’re saying I should store them as an exponent?

Yeah, store the exponent and the number separately in the string.

I completely forgot that clickers/simulators reach exuberantly high numbers. Definitely a wide use case for this one. I’ll take a poke around at it later.

Sorry for the bump, but I think this would be more appropriate in #resources:community-resources.