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

I feel like those games create their own problems by using extremely inflated currency which can be solved by simply making the currency worth more. For example, instead of making thousands in the early game, it should be in the hundreds or less, thus eliminating the need for such large numbers that cannot be as efficiently represented as the regular numbers.

The only use of numbers beyond 9 quintillion I can think of are scientific computations.

2 Likes

It’s more for long term games, sure you might be starting off with lower numbers, but what about in a year or two?

The example I used, Miner’s Haven, is almost 8 years old and still getting updated, they hit the number limit years ago.

You also have games with the goal of getting large amounts of money, or just seeing numbers go up.

This module isn’t for every game obviously, but there are plenty of games that go above quintillions.

If you have that much money and can’t get rid of it, it’s probably a wake up call to grind in a different game. Are you sure that isn’t the problem with game’s mechanics? I never saw anyone hit the 64-bit integer limit with exception being exclusively simulator games, as where I mentioned before are known to have extremely inflated currency, whereas in games like Jailbreak people had a lot but never extremes like quadrillions.

The module definitely has its uses, but I still fail to see why a video game would need it; especially given the fact that big number modules are a ton slower than native numbers and require plenty of extra unnecessary work which can be avoided all together with a change to game’s economy.

Changing an existing games economy is hard to do, to the point it might not be worth it.

This module, while taking extra effort, can be put into existing games without revamping what could be years of progression, and newer games you just need to call IM.new() and usage is almost the same as normal numbers.

I’m not sure what the problem is with having higher numbers, plenty of not just Roblox, but real games as well, have very high numbers. Idle games, clicker games, general number games, Roblox “simulators” and tycoons.

This module has very good performance, you can still do hundreds if not thousands of calculations per second without frame drops. It doesn’t have super precision like BigNum, it has the same 16 digit precision as double float values.

Again, obviously this module is not for every game, so comparing Jailbreak to a module for sims and tycoons makes little sense.

I wouldn’t stop playing a game just because it has big numbers, an inflated economy will obviously happen with this module, which is why its not really made for games with trading economies.

1 Like

could u make a function for checking IsINF, IsNAN, and IsNIL like EternityNum 2? but it dont affect to performance and if compared with ScientificNotation i hope its much more better and efficience, bc im also currently issued with ScientificNotation take alot of usage performance server

You shouldn’t be using ScientificNotation on the server. ScientificNotation is only for displaying the number to players.

It just converts the number into the format Roblox uses for bigger numbers, turning something like “1, 500” into 1e+500.

It shouldn’t be used for math or comparison, just for displaying as a text.

For checking if nil, you can do

if InfiniteMath.new(1) == nil then

For INF you do

if InfiniteMath.new(1) == InfiniteMath.new(1e+999) then

For NAN you do

if InfiniteMath.new(1) == InfiniteMath.new(0/0) then


image
image

No reason to use ScientificNotation here, just compare to new InfiniteMath numbers.

If Num >= InfiniteMath.new(1) and Num <= InfiniteMath.new(1.79e+308) then

You could also just check if Num:Reverse() is INF or not

if Num:Reverse() >= 1e+999 then

do using too many of Inf.new that could cost performance?

.new() should be more performant than ScientificNotation, but I recommend you use Reverse as its what you’re looking for.

ScientificNotation does work to convert the number into a string formatted like Roblox does, Reverse just returns the number put together, which is a lot more performant.

image
Reserve() make nil to 0

How to fix it?

I’m not having that issue, make sure your module is up to date or try printing adjustedRNG[i].val

image

image

i update when u added log and log10

Your number is basically 0. It is 0.0000000000000000000000000000013960393930058239. The module shouldn’t be using negative amount of zeros (which makes it a decimal).

It does return nil when I try InfiniteMath.new("1, -29"):Reverse()

For now, use Floor to round it down to 0.

local ScientificicedNum = InfiniteMath.floor(adjustedRNG[i]):Reverse()

I’ll fix the module using a negative amount of zeros.

how i can fix being nil



somehow its stuck/max at 1
image

why?
image
bc this? edit: it not work


i test this and it fixed (for me)

Nice module, I’m considering of using this over EternityNum 2 for my game :slight_smile:

2 Likes

EternityNum2 is way efficience and faster than this module (about 35-70%) but this module is easier usage while this module use metamethod but its bad for performance

2 Likes