InfiniteMath | Go above 10^308/1e+308!

I’m confused what you mean by “code in suffixes”. Do you mean you want to be able to display numbers in scientific notation? The module has plenty of documentation so its very easy to learn as well.

1 Like

1.3.9 is out with more fixes and a new function, SetValue!

  • Fix comparisons not correctly comparing negative and positive numbers. -45 > 0 would return true, this would impact comparison and any function that used it (min, max, clamp, etc.). It now correctly returns false.

  • Adds a new :SetValue() function. This sets the value of a constructed number, which is better practice than creating a new number with a different value as it doesn’t need to create new metatable (better for memory I believe). The function takes a new first and second and sets the first and second of the constructed number to the new values.

  • Fixed an error with :ConvertFromLeaderboards() when given 0.

  • Fixed an issue with :aaNotation() where instead of using z it would use scientific notation.

1 Like

idk if you answered it, but if you have 1e+2M cash
will it be actually 1 with 2M zeros?

1 Like

Short answer, yes.

Long answer, we store the coefficient and exponent of the number, to store 1e+2M we would just store {1, 2000000}. The modules arithmetic is built to work with the coefficient and exponent being separated, so we can do math still. So even if we’re storing 1 and 2M, we mathematically have 1e+2M.

1 Like

1 iotaCoin pls; magic!! Anyway it is needed that we have limits in :grinning:

1 Like

btw i always get an error:

INF number is not allowed. Please use "string" or "table" instead of "number" to go above INF. 

how do i fix it.

and btw how can you use the module itself, i have no experience or anything with it.

ok wait i found a documentation, give me time to read it!

1 Like

That error means that the number you’re trying to use is above 1e+308 and is INF. You can instead use a table with the coefficient and exponent, for 1e+308 it’d be {1, 308}, 1e+2M is {1, 2000000}

1 Like

i mean like how to convert a number to a table, it doesnt say it on the document

my scripting skills are like -1e+1e+308

1 Like

You want to use InfiniteMath.new(). If the number isn’t INF, basically if its below 1e+308

print(InfiniteMath.new(1)) -- 1
print(InfiniteMath.new(1e+100)) -- 1e+100
print(InfiniteMath.new({1, 2000000})) -- 1e+2M

From there you can do arithmetic (+, -, *, /, ^) on the number

local Num = InfiniteMath.new(50)
print(Num - 1) -- prints 49
1 Like

you dont understand… i want to convert for example 30000 to a table like

-- 30000 ---> {3,4}, 35000 ---> {3.5,4}
-- 1e+300 ---> {1,300}

roblox thinks my coins value is inf, how do make it not inf

1 Like

You can use .new() and access .first and .second of the number to get those.

local Num = InfiniteMath.new(30000)
print(Num.first, Num.second) -- prints 3, 4

Your coin value is INF because it goes over 1e+308 and isn’t using the module. You don’t want to turn InfiniteMath numbers back into regular numbers or it’ll become INF.

1 Like

so when the values load up i instantly use the module

	if Saved then
		if BlocksDS then
			b.Value = IM.new(BlocksDS)
			c.Value = IM.new(CoinsDS)
			r.Value = IM.new(RebirthsDS)
		end
	end

it’s still inf, does roblox automatically make those numbers inf?

1 Like

if b, c, and r are NumberValues then that explains it. You can’t store a table inside a NumberValue.

If you wanted to store a constructed number in a NumberValue, you’d need to use 2 NumberValues, 1 for coefficient and 1 for exponent. Then when you want to do math on the number you reconstruct it.

However I’d recommend you don’t use them and instead keep your numbers in code.

1 Like

ok, so i managed to fix it, but now i have another problem.

lets say:

local coinsS = "0, 0"
Coins.Value = IM.new(coinsS)

it works right?

when i change the coinsS to like “1, 2” it doesn’t change the value.

I was like: ooh i forgot the loops.

when i added the loop it still doesnt work. i used printing and it prints “1, 2”. so, what’s the problem?

Edit: there is no error
Edit2: i fixed it

1 Like

1.3.10 is here, with improvements to :aaNotation() and .new(), which should improve datastore implementations.

  • Improved :aaNotation() by adding a new variable called ‘AALENGTHMAX’, which lets you set the amount of letters used. The letter amount will also only start at 1 letter, and add more as the number needs them. Once a number reaches 1z, it will turn into 1aa. 1zz into 1aaa, up until it hits AAMAXLENGTH. The default value for AAMAXLENGTH is 3

  • Improves .new() usage with tables. Before, a table with first and second would be assumed as a constructed number, and just return the table. This doesn’t account for if the metatable info is lost when saved in a datastore or sent through a RemoteEvent. .new() now checks for the metatable and correctly creates numbers that have first and second values.

1 Like

Could you make it so the suffixes are infinite? I really don’t like the look of e+(some number here) and it also makes it so it’s harder to know how much you need for the next upgrade etc. You could probably take inspiration from eternity num to make it work.

1 Like

Unfortunately I can’t really make an infinite amount of suffixes. The most I’ve found is up to 1e+12000 using this page. If you can find me a list that goes higher then I’ll use it.

If you don’t like scientific notation (e+), try using aaNotation, it uses letters, 1Q = 1a, 1QN = 1b, etc. You can set a max number of letters, 1e+50000 = 100xpv, and that’s just with 3 letters.

Do you think you could maybe do it so instead of showing something like 1a it would be 1Q that way it would serve as infinite suffixes, example of this feature in another module (Eternitynum):
image

This number resembles 10 ^ 10 Million

It merges alot of suffixes together to create a bigger suffix (some of the suffixes you have on your list also do it but it’s written down and not done automatically)

I want to use the module but the model link is dead and its outdated in the uncopylocked game.