0 dependicies, tryes to fix floats, keeps Infinity and NaN after JSON, and overall should be fast
To use, just download .ts or .js (JS auto created by esbuild) file of Overlimit
It uses 2 numbers ([mantissa, exponent]) instead of native 1 to have higher limit
- Static compareFunc, used inside native sorting function, first value must be Overlimit: Array.sort((a, b) => Overlimit.compareFunc(b, a)); This will be equal to b - a
- Standart, nothing special: plus, minus, multiply, divide, abs, lessThan, lessOrEqual, moreThan, moreOrEqual, notEqual, equal, max, min, trunc, floor, ceil, round
- power, root - Second arqument must be a number
- log, logExp - logExp allows to have negative base (because I don't agree with modern Math, but it doesn't use complex numbers so answer might end up being NaN anyway)
- isNaN, isFinite - Only reacts to mantissa
- format - For basic formatting because string numbers are saved as 1e1 instead of 10 (returns a String)
- replaceNaN - Replaces current value with provided, but only if current one is NaN
- clone, setValue - Clone will create new Overlimit, setValue will overwrite current value
- toNumber, toSafeNumber, toString, toArray - returns a diffent type version, safeNumber will return Number.MAX_VALUE in case of NaN/Infinity after conversion; String version can be converted with Number(); Array version is readonly
- all + FunctionName - Same functions, but they can use any amount of arguments (they aren't faster, but also probably not slower. Maybe max/min are faster)
- '1 ** Infinity', '1 ** NaN' now returns 1 instead of NaN
- '0 ** 0', 'NaN ** 0' now retuns NaN instead of 1
- '0 * Infinity', '0 * NaN' now returns 0 instead of NaN
- 'Infinity / 0', '-x ** Infinity' now returns NaN instead of Infinity
- '0 / NaN' now returns 0 instead of NaN