A large number library that you can copy-paste directly into your .js file. It is easier to use than traditional libraries, is not very laggy (my game Exotic Matter Dimensions uses it and the lag is minimal) and only takes up around 100 lines of code (60 if you are using Fundamental).

infOP, similarly to logarithmica.numerus by Aarex Tiaokhiao, stores each number as a logarithm - for example, the number 149600000 is stored as 8.174931594 (Such variables are referred to as infNumbers in the code). This allows numbers to go up to 1e1.79e308. The built-in functions make it easy to add, subtract and format these infNumbers.

infOP is split into Fundamental and Advanced versions. The Fundamental version only includes only the Fundamental Functions and is more compact (as well as being easier to use), whereas the Advanced version includes all functions documented here but is a lot longer.

In this documentation and function names, the prefix norm indicates an ordinary number input (5 means 5) and the prefix inf indicates an infNumber input (5 means 100000)

Orangelinks are currently being updated and should not be used to update your version of infOP.

infAdd

This function adds two infNumbers. For example, infAdd(1.743,0.296) will return log(10^1.743+10^0.296), which is 1.758245417.

Syntax: infAdd(x,y) where x and y are the infNumbers you want to add

infSubtract

This function subtracts two infNumbers. For example, infSubtract(1.758,0.296) will return log(10^1.758-10^0.296), which is 1.742745812.

Syntax: infSubtract(x,y) where y is the infNumber you want to subtract from x.

infFormat

This function formats an infNumber as an ordinary number. For example, infFormat(33.374,false) will return 2.36e33, infFormat(23.456,false) will return 287.57 Sx and inf(1.4,false) will return 25.

Syntax: infFormat(x,decimal) where x is the number you want to format and decimal is a boolean - if decimal is enabled, numbers below 10 will retain 2 decimal points instead of being rounded down. So:
infFormat(0.75,true) returns 5.62 (helpful for when you want accurate values, for example upgrade effects)
infFormat(0.75,false) returns 5 (helpful for when you want integer values, for example styling currency)
infFormat(1.3,true) returns 19 (decimal only rounds numbers below 10)

NOTE: infFormat uses mixed scientific notation by default, meaning numbers between 1e3 and 1e33 are formatted with Antimatter Dimensions standard notation by default. To change this, find the Mixed scientific variable in the code for the language you are using and replace it with Scientific or the notation you want. Supported notations are:

* This is a joke notation, but it isn't "painful" (like some notations in Antimatter Dimensions) and can be useful if your game has uncontrollable growth (or if you're just making an ordinal game)
** This is similar to the Antimatter Dimensions notation but caps at e1.8e308 ("true" infinity) instead of 1.8e308.

normFormat

This function is identical to infFormat, but treats the input as if it were a normal number. So normFormat(2**256) returns 1.15e77 instead of e1.15e77. normFormat only starts using mixed scientific notation past 10000 instead of 1000, so normFormat(1753) still returns 1753.

Also, numbers below 100 are always rounded to 2 decimal digits, so normFormat(31.4159265) returns 31.41 instead of 31. Useful for removing excess digits.

timeFormat

This function formats an amount of seconds as a time - for example, timeFormat(0.753) returns 0.753 seconds, timeFormat(37) returns 37 seconds and timeFormat(90123) returns 1 day 1:02:03.

This is not related to large numbers but is included as part of the code as it is useful if your game includes statistics like many popular incrementals do.

The twoDigits function formats a one-digit number as 2 digits and has very limited practical use.

infMultiply / infDivide / infExponent

These functions do not exist as they can easily be replicated with the basic operators.

infMultiply: infMultiply(x,y) = x+y. As 1e7*1e4=1e11, 7+4=11.

infDivide: infDivide(x,y) = x-y. As 1e9/1e3=1e6, 9-3=6.

infExponent: infExponent(x,y) = x*y assuming x is an infNumber and y is a regular number. As 1e7^4=28, 7*4=28.

normLinearSoftcap

This function linearly softcaps an ordinary number. It takes three inputs: value, start and power in the form normLinearSoftcap(value,start,power).
value is the value that is getting softcapped. For example, if the base effect of an upgrade is 10x, you would input 10 here.
start is the start of the softcap. For example, if you want diminishing returns past 5x, you would input 5 here.
power is how harsh the softcap is. At high values, the function's output is directly proportional to the power+1th root of value. For example, if you want the effect of an upgrade to be cube rooted after a certain point, you would input 2 here.

Unlike many softcapping functions, this function (and the other softcapping functions) see a gradual change in derivative instead of a sudden unexplained slowdown.

Examples:
normLinearSoftcap(5.1,5,1) returns 5.099019513592785
normLinearSoftcap(6.1,5,1) returns 6
normLinearSoftcap(25,5,1) returns 15
normLinearSoftcap(1000,5,0.2) returns 481.03608171937344
normLinearSoftcap(1000,5,5) returns 16.287883532425063

Alternatively, power can be negative (for the opposite effect - a number increases faster past a certain value). power must never be less than or equal to -1.

Examples:
normLinearSoftcap(6,5,-0.5) returns 6.05
normLinearSoftcap(30,10,-0.5) returns 40
normLinearSoftcap(100,10,-0.99) returns 55290.40791825879

It is recommended to use the Scaling functions for this unless one of your upgrades weakens a softcap to the point of reversing it.

infLinearSoftcap

This function linearly softcaps an infNumber. It takes the same three inputs as normLinearSoftcap - value, start and power and has the same structure. However, value and start are infOP exponents and so is the output. power is still a regular number and can still go below 0 (though not below -1).

Examples:
infLinearSoftcap(0.78532983501,0.69897000433,1) returns 0.7781512503820742 (10^0.78532983501=6.1, 10^0.69897000433=5, 10^0.7781512503820742=6)
infLinearSoftcap(10000,10,1) returns 5005.150514997832
infLinearSoftcap(2,1,-0.5) returns 2.4807253789884878

LogarithmicSoftcap

This function logarithmically softcaps a number. It still takes three inputs: value, start and power in the form LogarithmicSoftcap(value,start,power).
value is the value that is getting softcapped. For example, if the base effect of an upgrade is 10x, you would input 10 here.
start is the start of the softcap. For example, if you want diminishing returns past 5x, you would input 5 here.
power is how harsh the softcap is. At high values, the function's output is directly proportional to ln(value)^(1/power). For example, if you want a weak softcap, you would input a number such as 0.02 and get ln(value)^50 at very high values.

power cannot be negative for this function. For scaling purposes, use the Scaling functions or make your own.

Examples:
LogarithmicSoftcap(11,10,1) returns 10.95310179804325
LogarithmicSoftcap(1e100,10,0.01) returns 3.8154699884172203e52
LogarithmicSoftcap(1e100,10,10) returns 21.66726703913011

Note: This function has no equivalent for exponents as due to the laws of logarithms it would have the same outputs as this version.

SuperlogSoftcap

This function superlogarithmically softcaps a number. It takes three inputs of value, start and power.

Examples:
SuperlogSoftcap(1e10,10,1) returns 41.034383226147
SuperlogSoftcap(1e300,10,1) returns 46.297238576706725
SuperlogSoftcap(1e156,10,2) returns 10 (see why below)

The result of this function is equal to start*slogₑ((value/start)**(1/power))**power. As a result, if value**power exceeds 1.79e308, the function will break. This will not cause a NaN error and simply return start - however, it is recommended to not use this function with a power of more than 1.

ConvergentSoftcap

This function is different from the other softcapping functions. It takes three inputs: value, start and end, structured as ConvergentSoftcap(value,start,end). Once value exceeds start, it will approach but never reach end. Useful for percentage-based upgrades (to never exceed 100%) or sometimes for other purposes.

Examples:
ConvergentSoftcap(80,75,100) returns 79.16666666666667
ConvergentSoftcap(100,50,100) returns 75
ConvergentSoftcap(10000,50,100) returns 99.75

Alternatively, end can be less than start for the same effect.

Examples:
ConvergentSoftcap(2,1,0) returns 2
ConvergentSoftcap(-0.1,0.5,0) returns 0.22727272727272727

normLinearScaling

This function linearly scales an ordinary number, meaning it increases faster past a certain value. It takes three inputs: value, start and power, structured as normLinearSoftcap(value,start,power).

Examples:
normLinearScaling(15,5,1) returns 25
normLinearScaling(9,8,2) returns 9.130208333333332

At high values, the output of this function is directly proportional to value^(power+1)

infLinearScaling

This function linearly scales an infNumber. It takes the same three inputs as normLinearScaling.

Examples:
infLinearScaling(40,8,2) returns 103.52287874528034
infLinearScaling(1.2,0.7,1) returns 1.4403626894942436

normSemiexpScaling

This function semi-exponentially scales an ordinary number. Semi-exponential scaling is faster than linear scaling, but a lot slower than exponential scaling. It takes three inputs: value, start and power.

Examples:
normSemiexpScaling(1e25,1e5,1) returns 5e124
normSemiexpScaling(1e25,1e10,2) returns 5.927598033463074e155

At high values, the output of this function is proportional to start^logₛₜₐᵣₜ(value)^(power+1).

infSemiexpScaling

This function semi-exponentially scales an infNumber. It takes the same three inputs as normSemiexpScaling.

Examples:
infSemiexpScaling(25,5,2) returns 624.5228787452803
infSemiexpScaling(1e25,1e10,2) returns 1e55

ExponentialScaling

This function exponentially scales a number. It only takes two inputs: value and start.

Examples:
ExponentialScaling(20,10) returns 27.18281828459045
ExponentialScaling(100,10) returns 81030.83927575384

At high values, the result of this function is proportional to e^(value/start)

SuperexpScaling

This function tetrationally scales. It takes three inputs: value, start and power.

Examples:
SuperexpScaling(20,10,1) returns 27.18281828459045
SuperexpScaling(45,10,1) returns 5.638772246433441e79
SuperexpScaling(16.5,10,3) returns 3.577943486327942e25

The result of this function is equal to start*⁽ᵛᵃˡᵘᵉ/ˢᵗᵃʳᵗ⁾^ᵖᵒʷᵉʳe^(1/power). As a result, if value**power exceeds 1.79e308, the function will break. This will not cause a NaN error and simply return 1.79e308 - however, it is recommended to not use this function with a power of more than 1.

infFloor

This function floors an infNumber. It takes one input, which is x - this is the value getting floored.

Examples:
infFloor(0.5) returns 0.47712125471966244 (input 3.162, output 3)
infFloor(3.1415926) returns 3.1414497734004674 (input 1385.4555604086302, output 1385)

safeExponent

This function can safely raise a negative number to a power. It takes two inputs of base and exponent.

Examples:
safeExponent(3,4) returns 81
safeExponent(-3,4) returns -81
safeExponent(0,0) returns 0

This isn't related to infNumbers directly, but can be useful if an infNumber goes below 1 (in which case it is stored as a negative number) and one of your formulas takes the exponent of a logarithm

normSimplex

This is the simplex function for ordinary numbers. normSimplex(x,y) calculates the xth y-simplex number.

Examples:
normSimplex(3,2) returns 6 (3rd triangular number)
normSimplex(5,3) returns 35 (5th tetrahedral number)
normSimplex(3.5,4) returns 23.4609375 (3.5th pentatope number)

infSimplex

This is the simplex function for infNumbers. infSimplex(x,y) where x is an infNumber and y is ordinary will output the base 10 logarithm of the 10^xth y-simplex number.

Examples:
infSimplex(1,2) returns 1.7403626894942439 (input 10, output 55)
infSimplex(100,4) returns 398.61978875828845 (input 1e100, output 4.1667e398)

infOP VI

- infFormat and normFormat now format numbers less than 1,000,000 using commas rather than the set notation

infOP V

- Added support for very small numbers
- Added Tetration notation
- Added functions for outputting triangular numbers, tetrahedral numbers and higher simplex numbers

infOP IV

- ExponentialScaling now takes in a power input
- Added Engineering notation

infOP III

- Added four new infFormat/normFormat notations (Alemaninc Ordinal, Double Logarithm, Logarithm, Infinity)
- Made some code smaller
- convergentSoftcap now supports end being less than start

infOP II

- Added softcap & scaling functions
- Added changelog
- Removed the README file and made an infOP website instead

infOP I

- Initial release
Dates are unavailable as each language updated at different times.