OmegaNum.js Docs

This document uses Rainbow with rainbow.css for syntax highlighting.

Properties

array

An array of integers that stores the magnitude of OmegaNum.
Array [a0,a1,a2,a3,...] represents the magnitude ...(10{3})a3(10^^)a2(10^)a1a0 It is always standardized to meet the following requirements(the value must be equivalent):

sign

Number representing the sign of OmegaNum. Either 1 or -1. 1 means positive, -1 means negative.

Methods (Arithmetic)

absoluteValue abs

Static: OmegaNum.absoluteValue(x), OmegaNum.abs(x)
Instance: <OmegaNum>.absoluteValue(), <OmegaNum>.abs()
Returns the absolute value of method.

        OmegaNum("10^^ee5").abs().toString() //"10^^ee5"
        OmegaNum.abs(-3.7e52).toString() //"3.7e52"
      

arrow

Static: OmegaNum.arrow(x,z,y)
Instance: <OmegaNum>.arrow(z)(y)
For static method, it is in form OmegaNum.arrow(x,arrows,y), while non-static method is x.arrow(arrows)(y). Uses linear approximation for real height.

        OmegaNum(13).arrow(3)(5).toString() //"(10^^)^3 (10^)^11 337385711567664.9"
        OmegaNum.arrow(6,4,5).toString() //"(10^^^)^3 (10^^)^4 eeee36305.31580191892"
        OmegaNum.arrow(6,4,5.001).toString() //"(10^^^)^3 (10^^)^4 eeeeeee394749617.28181416"
      
For non-static method, not having the second parameter will return function of the arrows.

ceiling ceil

Static: OmegaNum.ceiling(x), OmegaNum.ceil(x)
Instance: <OmegaNum>.ceiling(), <OmegaNum>.ceil()
Returns the ceiling of method.

        OmegaNum(2.34).ceil().toString() //"3"
        OmegaNum.ceil(-24.32).toString() //"-24"
      

compareTo cmp

Static: OmegaNum.compare(x,y), OmegaNum.cmp(x,y)
Instance: <OmegaNum>.compareTo(y), <OmegaNum>.cmp(y)
Compares two numbers, returns 1 if greater, 0 if equal, and -1 if less than.

        OmegaNum(5).cmp(3) //1
        OmegaNum.cmp(-8,3) //-1
        OmegaNum.cmp(6,6) //0
      

cubeRoot cbrt

Static: OmegaNum.cubeRoot(x), OmegaNum.cbrt(x)
Instance: <OmegaNum>.cubeRoot(), <OmegaNum>.cbrt()
Returns the cube root of the number.

        OmegaNum(5).cbrt().toNumber() //1.709975946676697
        OmegaNum.cbrt(-4).toNumber() //-1.5874010519681994
        OmegaNum.cbrt(3).toNumber() //1.4422495703074083
      

divide div

Static: OmegaNum.divide(x,y), OmegaNum.div(x,y)
Instance: <OmegaNum>.divide(y), <OmegaNum>.div(y)
Divides number by another.

        OmegaNum.div(6,2).toString() //"3"
        OmegaNum.div("ee5",2).toString() //"4.999999999978076e99999"
        OmegaNum.div("ee5","-10^^3").toString() //"-0"
      
That impresision tho

equalsTo eq

Static: OmegaNum.equalsTo(x,y), OmegaNum.equal(x,y), OmegaNum.eq(x,y)
Instance: <OmegaNum>.equalsTo(y), <OmegaNum>.equal(y), <OmegaNum>.eq(y)
Returns whether two numbers are equal.

        OmegaNum.div(5,5) //true
        OmegaNum.div(0,120) //false
        OmegaNum.div("10^^e16",[16,1,1]) //true
      

exponential exp

Static: OmegaNum.exponential(x), OmegaNum.exp(x)
Instance: <OmegaNum>.exponential(), <OmegaNum>.exp()
exp function. exp(x)=ex

        OmegaNum.exp(5).toString() //"148.41315910257657"
        OmegaNum.exp(1e+200).toString() //"e4.342944819032647e199"
        OmegaNum.exp("10^^100").toString() //"22026.465794806707"
      
What the hell happened

factorial fact

Static: OmegaNum.factorial(x), OmegaNum.fact(x)
Instance: <OmegaNum>.factorial(), <OmegaNum>.fact()
Factorial. Currently, it does not support non-integer input.

        OmegaNum.fact(10).toString() //"3628800"
        OmegaNum.fact(1e100).toString() //"e9.956570551809593e101"
      

floor

Static: OmegaNum.floor(x)
Instance: <OmegaNum>.floor()
Returns floor of number.

        OmegaNum.floor(12.7).toString() //"12"
        OmegaNum.floor("ee5e23").toString() //"eee23.69897000433602"
      

gamma

Static: OmegaNum.gamma(x)
Instance: <OmegaNum>.gamma()
Applies Gamma function.

        OmegaNum.gamma(0.5).toString() //"2"
        OmegaNum.gamma(5).toString() //"24.00018258045251"
        OmegaNum.gamma(1e50).toString() //"e4.956570551809682e51"
      

generalLogarithm log10

Static: OmegaNum.generalLogarithm(x), OmegaNum.log10(x)
Instance: <OmegaNum>.generalLogarithm(), <OmegaNum>.log10()
Returns general logarithm(log base 10) of number.

        OmegaNum.log10(62.69).toString() //"1.797198269838959"
        OmegaNum.log10("eee6.19").toString() //"4.15826806220026e1548816"
      

greaterThan gt

Static: OmegaNum.greaterThan(x,y), OmegaNum.gt(x,y)
Instance: <OmegaNum>.greaterThan(x,y), <OmegaNum>.gt(x,y)
Returns whether number is greater than other.

        OmegaNum.gt(102,512) //false
        OmegaNum.gt("ee4e5923","e43.348") //true
        OmegaNum.gt(5,5) //false
      

greaterThanOrEqualTo gte

Static: OmegaNum.greaterThanOrEqualTo(x,y), OmegaNum.gte(x,y)
Instance: <OmegaNum>.greaterThanOrEqualTo(y), <OmegaNum>.gte(y)
Returns whether number is greater than or equal to other.

        OmegaNum.gte(102,512) //false
        OmegaNum.gte("ee4e5923","e43.348") //true
        OmegaNum.gte(5,5) //true
      

hyper

Static: OmegaNum.hyper(z)(x,y)
Instance: None
Static only. OmegaNum.hyper(z)(x,y)=hyper-z(x,y).

        OmegaNum.hyper(4)(4,2).toString() //"256"
        OmegaNum.hyper(12)(923,592).toString() //"(10{9})^590 (10{8})^921 (10{7})^921 (10{6})^921 (10{5})^921 (10^^^^)^921 (10^^^)^921 (10^^)^921 (10^)^922 2737.3532242875053"
      

isFinite

Static: OmegaNum.isFinite(x)
Instance: <OmegaNum>.isFinite()
Returns whether number is finite.

        OmegaNum.isFinite(6) //true
        OmegaNum.isFinite(NaN) //false
        OmegaNum.isFinite(Infinity) //false
      

isInfinite

Static: OmegaNum.isInfinite(x)
Instance: <OmegaNum>.isInfinite()
Returns whether number is infinite.

        OmegaNum.isInfinite(6) //false
        OmegaNum.isInfinite(NaN) //false
        OmegaNum.isInfinite(Infinity) //true
      

isInteger isint

Static: OmegaNum.isInteger(x), OmegaNum.isint(x)
Instance: <OmegaNum>.isInteger(), <OmegaNum>.isint()
Returns whether number is an integer.

        OmegaNum.isint(4) //true
        OmegaNum.isint(8.2) //false
      

isNaN

Static: OmegaNum.isNaN(x)
Instance: <OmegaNum>.isNaN()
Returns whether number is NaN.

        OmegaNum.isNaN(3) //false
        OmegaNum.isNaN(NaN) //true
      

isNegative isneg

Static: OmegaNum.isNegative(x), OmegaNum.isNeg(x)
Instance: <OmegaNum>.isNegative(), <OmegaNum>.isNeg()
Returns whether number is negative.

        OmegaNum.isneg(5) //false
        OmegaNum.isneg(-3) //true
      

isPositive ispos

Static: OmegaNum.isPositive(x), OmegaNum.ispos(x)
Instance: <OmegaNum>.isPositive(), <OmegaNum>.ispos()
Returns whether number is positive.

        OmegaNum.ispos(5) //true
        OmegaNum.ispos(-3) //false
      

iteratedexp

Static: OmegaNum.iteratedexp(x,y[,z])
Instance: <OmegaNum>.iteratedexp(y[,z])
Alias for tetr.

iteratedlog

Static: OmegaNum.iteratedlog(x,y,z)
Instance: <OmegaNum>.iteratedlog(y,z)
Repeatedly applies log base y to x z times. z can be real.

lambertw

Static: OmegaNum.lambertw(x)
Instance: <OmegaNum>.lambertw()
Applies Lambert W function.

        OmegaNum.lambert(-0.1).toString() //"-0.11183255915896297"
        OmegaNum.lambert(1).toString() //"0.5671432904097838"
        OmegaNum.lambert(10).toString() //"1.7455280027406992"
      

layeradd

Static: OmegaNum.layeradd(x,y,z)
Instance: <OmegaNum>.layeradd(y,z)
Adds z layers of exponential tower of base y of x at the bottom. z can be real.

layeradd10

Static: OmegaNum.layeradd10(x,y)
Instance: <OmegaNum>.layeradd10(y)
Adds y layers of exponential tower of base 10 of x at the bottom. y can be real.

lessThan lt

Static: OmegaNum.lessThan(x,y), OmegaNum.lt(x,y)
Instance: <OmegaNum>.lessThan(y), <OmegaNum>.lt(y)
Returns whether number is less than other.

        OmegaNum.lt(102,512) //true
        OmegaNum.lt("ee4e5923","e43.348") //false
        OmegaNum.lt(5,5) //false
      

lessThanOrEqualTo lte

Static: OmegaNum.lessThanOrEqualTo(x,y), OmegaNum.lte(x,y)
Instance: <OmegaNum>.lessThanOrEqualTo(y), <OmegaNum>.lte(y)
Returns whether number is less than or equal to other.

        OmegaNum.lte(102,512) //true
        OmegaNum.lte("ee4e5923","e43.348") //false
        OmegaNum.lte(5,5) //true
      

logarithm logBase

Static: OmegaNum.logarithm(x[,y]), OmegaNum.logBase(x[,y])
Instance: <OmegaNum>.logarithm([y]), <OmegaNum>.logBase([y])
Returns logarithm of number with a base.

        OmegaNum(3).logBase(2).toString() //"1.584962500721156"
        OmegaNum.logBase("e3.5e393",5891).toString() //"9.283354173739596e392"
      

minus sub

Static: OmegaNum.minus(x,y), OmegaNum.sub(x,y)
Instance: <OmegaNum>.minus(y), <OmegaNum>.sub(y)
Subtraction.

        OmegaNum.sub(634,623).toString() //"11"
        OmegaNum.sub("ee6.238","ee6.239").toString() //"-9.948420585793617e1733803"
      

modular mod

Static: OmegaNum.modular(x,y), OmegaNum.mod(x,y)
Instance: <OmegaNum>.modular(y), <OmegaNum>.mod(y)
Modulo operation without floor.

        OmegaNum.mod(32,7).toString() //"4"
        OmegaNum.mod("e13.523",6232).toString() //"1683.47265625"
      

naturalLogarithm log ln

Static: OmegaNum.naturalLogarithm(x), OmegaNum.log(x), OmegaNum.ln(x)
Instance: <OmegaNum>.naturalLogarithm(), <OmegaNum>.log(), <OmegaNum>ln()
Returns the natural logaritha.

        OmegaNum.ln(382.42).toString() //"5.946519481064813"
        OmegaNum.ln("eee1").toString() //"23025850929.940456"
      

negate neg

Static: OmegaNum.negate(x), OmegaNum.neg(x)
Instance: <OmegaNum>.negate(), <OmegaNum>.neg()
Returns the negated value.

        OmegaNum.neg(523).toString() //"-523"
        OmegaNum.neg(-921.3).toString() //"-921.3"
      

notEqualsTo neq

Static: OmegaNum.notEqualsTo(x,y), OmegaNum.notEqual(x,y), OmegaNum.neq(x,y)
Instance: <OmegaNum>.notEqualsTo(y), <OmegaNum>.notEqual(y), <OmegaNum>.neq(y)
Returns whether two numbers are not equal.

        OmegaNum.div(5,5) //false
        OmegaNum.div(0,120) //true
        OmegaNum.div("10^^e16",[16,1,1]) //false
      

pentate pent

Static: OmegaNum.pentate(x,y), OmegaNum.pent(x,y)
Instance: <OmegaNum>.pentate(y), <OmegaNum>.pent(y)
Pentation. Uses linear approximation for real height.

        OmegaNum.pent(3,3).toString() //"(10^)^7625597484984 3638334640023.7783"
        OmegaNum.pent(3,3.1).toString() //"10^^1.0184927774689214e591"
        OmegaNum.pent("e5e18","ee5e10").toString() //"10^^^e1e50000000000"
      

plus add

Static: OmegaNum.plus(x,y), OmegaNum.add(x,y)
Instance: <OmegaNum>.plus(y), <OmegaNum>.add(y)
Addition.

        OmegaNum.add(63942334,"e16.523").toString() //"3.334264134026562e16"
        OmegaNum.add(3923,-34823).toString() //"-30900"
      

reciprocate rec

Static: OmegaNum.reciprocate(x), OmegaNum.rec(x)
Instance: <OmegaNum>.reciprocate(), <OmegaNum>.rec()
Returns the reciprocal.

        OmegaNum.rec(432).toString() //"0.0023148148148148147"
        OmegaNum.rec(-0.00045).toString() //"-2222.222222222222"
      

root

Static: OmegaNum.root(x,y)
Instance: <OmegaNum>.root(y)
Returns the y-th root of x.

        OmegaNum.root(523,4).toString() //"4.782174531743749"
        OmegaNum.root(252.43,7).toString() //"2.203753399900375"
      

round

Static: OmegaNum.round(x)
Instance: <OmegaNum>.round()
Returns the rounded number.

        OmegaNum.round(52.32).toString() //"52"
        OmegaNum.round(-68.23).toString() //"-68"
      

slog

Static: OmegaNum.slog(x[,y])
Instance: <OmegaNum>.slog([y])
Applies super-logarithm. Uses linear approximation for real height.

        OmegaNum.slog(0,10).toString() //"-1"
        OmegaNum.slog(2,10).toString() //"0.30102999566398125"
        OmegaNum.slog(3814279.1047601975,Math.E).toString() //"3"
      

squareRoot sqrt

Static: OmegaNum.squareRoot(x), OmegaNum.sqrt(x)
Instance: <OmegaNum>.squareRoot(), <OmegaNum>.sqrt()
Returns the square root.

        OmegaNum.sqrt(16).toString() //"4"
        OmegaNum.sqrt("e5e10").toString() //"1e25000000000"
        OmegaNum.sqrt(-1).toString() //"NaN"
      

ssqrt ssrt

Static: OmegaNum.ssqrt(x), OmegaNum.ssrt(x)
Instance: <OmegaNum>.ssqrt(), <OmegaNum>.ssrt()
Applies square super-root.

        OmegaNum.ssrt(2).toString() //"1.5596104694623696"
        OmegaNum.ssrt(27).toString() //"3.0000000000000004"
        OmegaNum.ssrt("ee50").toString() //"2.0697116195395227e48"
      

tetrate tetr

Static: OmegaNum.tetrate(x,y[,z]), OmegaNum.tetr(x,y[,z])
Instance: <OmegaNum>.tetrate(y[,z]), <OmegaNum>.tetr(y[,z])
Tetration. Uses linear approximation for real height. z is placed on top of exponential tower (thus becoming iterated exponentiation).

        OmegaNum.tetr(3,3).toString() //"7625597484987"
        OmegaNum.tetr(10,2.5).toString() //"1.0972406760152253e1453"
        OmegaNum.tetr("e5e52",512).toString() //"(10^)^513 52.69897000433602"
        OmegaNum.tetr(1.2,Infinity).toString() //"1.2577345413765264"
      

times mul

Static: OmegaNum.times(x,y), OmegaNum.mul(x,y)
Instance: <OmegaNum>.times(y), <OmegaNum>.mul(y)
Multiplication.

        OmegaNum.mul(120,5).toString() //"600"
        OmegaNum.mul("e8e12","e2e13").toString() //"1e28000000000000"
      

toPower pow

Static: OmegaNum.toPower(x,y), OmegaNum.pow(x,y)
Instance: <OmegaNum>.toPower(y), <OmegaNum>.pow(y)
Exponentiation.

        OmegaNum.pow(5,5).toString() //"3125"
        OmegaNum.pow("e2e9","e5e9").toString() //"e2.0000007521745653e5000000009"
      

Methods (System)

fromArray

Static: OmegaNum.fromArray(x[,y])
Instance: None
Takes an Array and optionally a Boolean, and return an OmegaNum with given properties.

fromHyperE

Static: OmegaNum.fromHyperE(x)
Instance: None
Takes a String representing Hyper-E Notation and return an OmegaNum with the corresponding value.
Hyper-E notation syntax:
<syntax>          ::= <signs> <unsigned-syntax>
<unsigned-syntax> ::= <special> | <decimal> | "E" <inside>
<inside>          ::= <decimal> | <inside> "#" <decimal>
<special>         ::= "Infinity" | "NaN"
<signs>           ::= "" | <signs> <sign>
<sign>            ::= "+" | "-"
<decimal>         ::= <integer> | <integer> "." | "." <integer> | <integer> "." <integer>
<integer>         ::= "0" | <nonzero-integer>
<nonzero-integer> ::= <digit> | <nonzero-integer> <digit>
<digit>           ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"

fromJSON

Static: OmegaNum.fromJSON(x)
Instance: None
Takes a JSON in String or an Object and returns the corresponding OmegaNum.

fromNumber

Static: OmegaNum.fromNumber(x)
Instance: None
Takes a Number and returns the corresponding OmegaNum.

fromBigInt

Static: OmegaNum.fromBigInt(x)
Instance: None
Takes a BigInt and returns the corresponding OmegaNum.

fromObject

Static: OmegaNum.fromObject(x)
Instance: None
Takes an Object and returns the corresponding OmegaNum.

fromString

Static: OmegaNum.fromString(x)
Instance: None
Takes a String. If it is a Hyper-E notation or is a JSON, uses the corresponding function instead.
Notation syntax otherwise:
<syntax>              ::= <signs> <unsigned-syntax>
<unsigned-syntax>     ::= <special> | <left-syntax> <scientific-notation>
<left-syntax>         ::= "" | <operator-part> <left-syntax>
<operator-part>       ::= <operator-with-ten> | "(" <operator-with-ten> ")^" <nonzero-integer> " "
<operator-with-ten>   ::= "10" <hyper-operator>
<hyper-operator>      ::= <arrows> | <beaf-operator>
<beaf-operator>       ::= "{" <nonzero-integer> "}"
<arrows>              ::= "^" | <arrows> "^"
<scientific-notation> ::= <signed-decimal> | <signed-decimal> <exponential> <scientific-notation>
<signed-decimal>      ::= <signs> <decimal>
<exponential>         ::= "e" | "E"
<special>             ::= "Infinity" | "NaN"
<signs>               ::= "" | <signs> <sign>
<sign>                ::= "+" | "-"
<decimal>             ::= <integer> | <integer> "." | <integer> "." <integer>
<integer>             ::= "0" | <nonzero-integer>
<nonzero-integer>     ::= <digit> | <nonzero-integer> <digit>
<digit>               ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"

OmegaNum

Static: OmegaNum.OmegaNum(x[,y]), OmegaNum(x[,y])
Instance: None
The constructor of OmegaNum. Chooses and performs from fromArray, fromHyperE, fromJSON, fromNumber, fromBigInt, fromObject, or fromString accordingly.

standardize

Static: None
Instance: <OmegaNum>.standardize()
Standardize the properties to match the requirements. Automatically executed on performing methods. Mutating method.

toExponential

Static: None
Instance: <OmegaNum>.toExponential(places[,applyToOpNums])
An alias for toStringWithDecimalPlaces.

toFixed

Static: None
Instance: <OmegaNum>.toFixed(places[,applyToOpNums])
An alias for toStringWithDecimalPlaces.

toHyperE

Static: None
Instance: <OmegaNum>.toHyperE()
Converts into Hyper-E Notation.

        OmegaNum(52).toHyperE() //"52"
        OmegaNum("eee30").toHyperE() //"E30#3"
      

toJSON

Static: None
Instance: <OmegaNum>.toJSON()
Converts into Object with property "array" and "sign".

        OmegaNum(52).toJSON() //{array:[52],sign:1}
        OmegaNum("eee30").toJSON() //{array:[30,3],sign:1}
      

toNumber

Static: None
Instance: <OmegaNum>.toNumber()
Converts the number into Number.

        OmegaNum(52).toNumber() //52
        OmegaNum("eee30").toNumber() //Infinity
      

toPrecision

Static: None
Instance: <OmegaNum>.toPrecision(places[,applyToOpNums])
For small numbers, the number of decimal places to both sides of decimal point combined is fixed. Else, it is an alias for toStringWithDecimalPlaces (1 place removed).

toString

Static: None
Instance: <OmegaNum>.toString()
Converts the number into String.

        OmegaNum(100).toString() //"100"
        OmegaNum([5,3,2,0,0,1]).toString() //"10{5}(10^^)^2 e1e100000"
      

toStringWithDecimalPlaces

Static: None
Instance: <OmegaNum>.toStringWithDecimalPlaces(places[,applyToOpNums])
Converts the number into String with decimal places.

valueOf

Static: None
Instance: <OmegaNum>.valueOf()
Converts the OmegaNum to a primitive or a JSON object. Automatically used for JSON.stringify and casting. Configurable.

Options

debug

NONE 0 Show no information.
NORMAL 1 Show operations.
ALL 2 Show everything.
Setting this will output information on what operations are run to the console. Default is 0 (NONE).

maxArrow

Sets the maximum number of arrows are accepted when storing or operating. A number will turn Infinity if it exceeds this limit. Default is 1000.

serializeMode

JSON 0 JSON object
STRING 1 String
Sets the mode of what form is used when serializing for JSON.stringify and valueOf. Default is 0 (JSON).