Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Exponential

import { Exponential } from "https://raw.githubusercontent.com/JOTSR/Denum/master/mod.ts";
class Exponential extends AbstractValue<Exponential> {
constructor(
base: Frac | number,
exponent: Frac | number,
sign?,
);
get value();
get base();
get exponent();
 
abs(): Exponential;
compare(compared: Exponential): bigint;
divide(...exponentials: Exponential[]): Exponential;
invert(): Exponential;
isBetween(
includeBounds?,
);
isEqual(compared: Exponential): boolean;
isEven(): boolean;
isGreater(compared: Exponential, ifEqual?): boolean;
isInt(): boolean;
isLesser(compared: Exponential, ifEqual?): boolean;
multiply(...exponentials: Exponential[]): Exponential;
opposite(): Exponential;
power(...exponents: Frac[]): Exponential;
sign();
simplify(): Exponential;
toFloat(decimals?);
toJSON();
toLatex();
toString();
 
static fromFloat();
static fromJSON(json: string): Exponential;
static fromLatex(latex: string): Exponential;
static fromString(str: string): Exponential;
}

§Extends

§
AbstractValue<Exponential>
[src]

§Constructors

§
new Exponential(base: Frac | number, exponent: Frac | number, sign?)
[src]

The constructor function takes in a base, an exponent, and a sign, and sets the base, exponent, and sign of the object to the values passed in.

@param base
  • The base of the exponent.
@param exponent
  • The exponent of the power.

§Properties

§
value readonly
[src]
§
base readonly
[src]
§
exponent readonly
[src]

§Methods

§

Return a new Exponential object with the same base and exponent but with a positive sign

@return

Absolute value of the exponential

§
compare(compared: Exponential): bigint
[src]

If the sign is different, the one with the negative sign is lesser. If the sign is the same, the one with the lesser base or exponent is lesser else is equal

@param compared
  • Exponential
@return

The result of the comparison between the two numbers.

§
divide(...exponentials: Exponential[]): Exponential
[src]

"Divide this exponential by the given exponentials." The function then returns the result of multiplying this exponential by the inverses of the given exponentials

@param exponentials
  • Exponential[]
@return

The result of the division of the exponentials.

§

The inverse of an exponential (the same exponential with the opposite of the exponent)

@return

The opposite of the exponent.

§
isBetween(min: Exponential, max: Exponential, includeBounds?)
[src]

Returns true if the number is greater than or equal to the minimum and less than or equal to the maximum.

@param min
  • The minimum value of the range.
@param max
  • Exponential
@return

A boolean value

§
isEqual(compared: Exponential): boolean
[src]

It compares two numbers and returns true if they are equal.

@param compared
  • Exponential
@return

A boolean value.

§
isEven(): boolean
[src]

If the exponent is an integer and the base is even, or if the float value of the exponent is even, then return true.

@return

a boolean value.

§
isGreater(compared: Exponential, ifEqual?): boolean
[src]

If the compared value is greater than the current value, return true, otherwise return false.

@param compared
  • The number to compare to.
@return

The comparison of the two numbers.

§
isInt(): boolean
[src]

If the exponent and base are integers, or if the base^exponent result is an integer, then return true

@return

The result of the exponentiation of the base and exponent.

§
isLesser(compared: Exponential, ifEqual?): boolean
[src]

Returns true if the current number is lesser than the compared number, or if the numbers are equal and ifEqual is true.

@param compared
  • The number to compare to.
@return

A boolean value.

§
multiply(...exponentials: Exponential[]): Exponential
[src]

If all the exponents are the same, multiply the bases and keep the exponent. If all the bases are the same, add the exponents and keep the base

@param exponentials
  • Exponential[]
@return

A new Exponential object

§
opposite(): Exponential
[src]

The opposite of an exponential is the same exponential with the opposite sign.

@return

A new Exponential object with the same base and exponent, but with the opposite sign.

§
power(...exponents: Frac[]): Exponential
[src]

It returns a new Exponential object with the same base and an exponent that is the product of the current exponent and the exponents passed in.

@param exponents
  • Frac[]
@return

An Exponential object.

§
sign()
[src]

It returns the sign of the number.

@return

The sign of the number.

§
simplify(): Exponential
[src]
§
toFloat(decimals?)
[src]

Convert the number to a float32 point number with the specified number of decimal places." The function takes one parameter, decimals, which is a BigInt. The function returns a Number

@param decimals
  • The number of decimal places to round to.
@return

The value of the number.

§
toJSON()
[src]

returns a string that represents the object in JSON format

@return

A string that represents the object.

§
toLatex()
[src]

Return the LaTeX string corresponding to the value

@return

The latex representation of the expression.

§
toString()
[src]

The function returns an evaluable string representation of the object

@return

The string representation of the object.

§Static Methods

§
fromFloat()
[src]
§
fromJSON(json: string): Exponential
[src]
§
fromLatex(latex: string): Exponential
[src]
§
fromString(str: string): Exponential
[src]