Class default

The Decimal's value is simply mantissa * 10^exponent.

Hierarchy

  • default

Constructors

Properties

Accessors

Methods

abs absLog10 acosh add ascensionPenalty asinh atanh cbrt ceil clamp clampMax clampMin clone cmp cmp_tolerance compare compare_tolerance copyFrom cosh cube decimalPlaces div divide divideBy dividedBy dp egg eq eq_tolerance equals equals_tolerance exp factorial floor greaterThan greaterThanOrEqualTo gt gt_tolerance gte gte_tolerance isFinite isNaN isNegativeInfinity isPositiveInfinity lessThan lessThanOrEqualTo ln log log10 log2 logarithm lt lt_tolerance lte lte_tolerance mantissaWithDecimalPlaces max min minus mul multiply neg negate negated neq neq_tolerance normalize notEquals notEquals_tolerance pLog10 plus pow pow_base recip reciprocal reciprocate round setFromNumber setFromNumber_bypassCache setFromString setFromString_bypassCache setMantissaExponent setMantissaExponent_noNormalize sgn sign sinh sqr sqrt sub subtract tanh times toExponential toFixed toJSON toNumber toPrecision toString toStringWithDecimalPlaces trunc valueOf abs absLog10 add affordArithmeticSeries affordGeometricSeries cbrt ceil clamp clampMax clampMin cmp cmp_tolerance compare compare_tolerance const constant cube decimalPlaces div divide dp efficiencyOfPurchase eq eq_tolerance equals equals_tolerance exp floor fromMantissaExponent fromMantissaExponent_noNormalize fromNumber fromNumber_bypassCache fromString fromString_bypassCache fromValue_noAlloc gt gt_tolerance gte gte_tolerance ln log log10 log2 logarithm lt lt_tolerance lte lte_tolerance max min minus mul multiply neg negate negated neq neq_tolerance notEquals notEquals_tolerance pLog10 plus pow pow10 randomDecimalForTesting recip reciprocal reciprocate round sgn sign sqr sqrt sub subtract sumArithmeticSeries sumGeometricSeries times trunc

Constructors

Properties

exponent: number = NaN

A number (integer) between -EXP_LIMIT and EXP_LIMIT. Non-integral/out of bounds will cause bad things to happen.

mantissa: number = NaN

A number (double) with absolute value between [1, 10) OR exactly 0. If mantissa is ever 10 or greater, it should be normalized (divide by 10 and add 1 to exponent until it is less than 10, or multiply by 10 and subtract 1 from exponent until it is 1 or greater). Infinity/-Infinity/NaN will cause bad things to happen.

Accessors

  • get e(): number
  • Returns number

  • set e(value: number): void
  • Parameters

    • value: number

    Returns void

  • get m(): number
  • Returns number

  • set m(value: number): void
  • Parameters

    • value: number

    Returns void

  • get s(): number
  • Returns number

  • set s(value: number): void
  • Parameters

    • value: number

    Returns void

Methods

  • Joke function from Realm Grinder

    Parameters

    • ascensions: number

    Returns default

  • Parameters

    • value: MantissaExponent

    Returns void

  • Tolerance is a relative tolerance, multiplied by the greater of the magnitudes of the two arguments. For example, if you put in 1e-9, then any number closer to the larger number than (larger number)*1e-9 will be considered equal.

    Parameters

    Returns boolean

  • Parameters

    • base: number

    Returns number

  • Parameters

    • base: number

    Returns number

  • Parameters

    • places: number

    Returns number

  • Parameters

    • value: number

    Returns void

  • Parameters

    • value: number

    Returns void

  • Parameters

    • value: string

    Returns void

  • Parameters

    • mantissa: number
    • exponent: number

    Returns void

  • Well, you know what you're doing!

    Parameters

    • mantissa: number
    • exponent: number

    Returns void

  • Parameters

    • places: number

    Returns string

  • Parameters

    • places: number

    Returns string

  • Parameters

    • places: number

    Returns string

  • Parameters

    • places: number

    Returns string

  • Parameters

    • mantissa: number
    • exponent: number

    Returns default

  • Parameters

    • mantissa: number
    • exponent: number

    Returns default

Generated using TypeDoc