AlephNum | Calculate up to 10^^1e308

Calculate up to 10 ↑↑ 1e+308


AlephNum is a roblox number module inspired by other libraries like InfiniteMath and especially EternityNum. The name is inspired by the widely known transfinite number, Aleph-Null.

Explanation

AlephNum stores numbers in tables. Each AN table has 4 values: Sign, Mantissa, Exp, and Layer.
The number format is explained better on the Github Page, but compressing numbers this way lets it represent numbers way above the old limit (1e+308) and all the way up to 10 ↑↑ 1e+308 as shown above.

Usage

AlephNum uses metamethods and methods, which allow you to do things like this:

local value = AlephNum.fromNumber(2)
value:pow(1024) -- Does 2^1024 (1.797e308)
value *= 2 -- Does 2 * 2^1024

print(value:toScientific(3)) -- Prints "3.595e308"

Along with that, AlephNum has a config system, which you can change using AlephNum.setConfig. These are the current config options available:

AlephNum.Config = {
	["StrictMode"] = false, -- If true, the script will halt instead of give warnings when things go wrong.

	["Notation"] = "Scientific", -- Scientific (1e10), Suffix (1T), or None (100000000000000000000...)
	["SciNotation"] = "None", -- None (1e1000000000000), Scientific (1e2e3e10), or Suffix (1e20k)

	["Threshold"] = 1e3, -- How big a number needs to be to be abbreviated into the Notation.
	["SciThreshold"] = 10, -- Caps out scientific abbreviated numbers from being too long (2e1e1e1e1e1e1e1e1e1e1e1e1e10 vs 2 * 10 ^^ 14)

	["Digits"] = 2, -- How many decimal places are shown (1k or 1.23k or 1.234567k, etc.)
}

And also, on the unfortunate case that your script errors due to misuse on your part, dont worry! Most scripts send out an internal error where you cannot fix it. This script shows you the exact script and line thats causing the issue!

  10:31:30.585  ┏ [AlephNum] Division by zero! Defaulting to zero.  -  Server - AlephNum:1466
  10:31:30.585  ┗  ╸ Go to script: ServerScriptService.Server on line 7 to fix this.  -  Server - AlephNum:1467

Also, to check if there is a newer version out there, you can put AlephNum.checkVersion() at the top of your code!

Keep in mind, this does an HTTP request to the github releases, so you need to have HTTP requests on for this to work.

Why?

Why would you ever use AlephNum when other more popular libraries exist? Well, there are multiple reasons.

Sure, AlephNum doesnt have the biggest limits ever or the fastest code possible, but atleast it is developer friendly. The entire reason I am making this library is because I’m tired of other old libraries having bad source code and bad error output, etc. and I wanted developers who are new to navigating big numbers to have an easier time.

But, in case you dont care about all that, here are some other reasons why you should use AlephNum:

  • AlephNum is OrderedDataStore compatible up to 9e999, meanwhile without this you’d be stuck at 9.2e18!
  • AlephNum is more precise than EternityNum in most cases!
  • AlephNum has a higher limit than InfiniteMath by a long shot! (10 ↑↑ 1e+308 > 10^1e+308)
  • AlephNum can handle bigger operations than QuickNum!
  • AlephNum is constantly being worked on and isn’t outdated like most of its competitors!
  • and theres probably more reasons, but you get the point…

How to Install

You can get AlephNum from the latest release from Github, or by adding this to your wally dependencies list:

AlephNum = "archadiumm/alephnum@2.0.1"
3 Likes

I guess i could say, Aleph you for this module

how did you even get here so quick :sob:

1 Like

I check Community resources all days, at all times

1 Like

ok now make it able to calculate TREE(3), thats a fun challenge

1 Like

alyanum maybe can do that, at the serious cost of precision lol
im not sure what the value of TREE(3) is, or if it has even been approximated

1 Like

It was a joke, it’s literally impossible to calculate it, the problem is, you know the Planck scale, well when we go ahead and try to go smaller, to view or do stuff smaller than a Planck space, the energy required would doom us by being so much it creates a black hole, now a Planck space is 4.2210^(-105) that being the volume based on the Planck length of 1.610^(-35), and in the observable universe there is approximately 8.45*10^184 Planck spaces, now the universe is thought to be substantially bigger than the observable universe, this is because it expands at the speed of light making it so there is a boundary where light is not moving towards us because it is being pulled away from us, anyways, the amount of Planck spaces in the universe is not enough, by orders of magnitude, to if each Planck space had a character there is not enough to calculate the equation to get the finite number of TREE(3), this is bigger than any number known but TREE(x) is always finite and supports any number, TREE(2) is 3 which is just crazy that one more number makes it bigger than any known number, which it just gets bigger the bigger the number inputted, anyways just letting you know.

looks internesting, I’ll probably save it if I decide to do a mega-incremental game

i mean, just to clarify it isnt just meant for “huge number limit wow!!! :scream::scream::scream:. If it was, i would have went for the route alyanum did (it can calculate heptations)

its just meant to handle numbers above 1e+308 in a very developer friendly way :innocent:

1 Like