Class Rat

Name

Rat

Hierarchy

  • Rat

Constructors

  • Initialize a rational number.

    Parameters

    • numerator: number | bigint = ...
    • denominator: number | bigint = ...

    Returns Rat

Properties

d: bigint
n: bigint

Accessors

  • get profile(): string
  • Returns a text profile of the number in various formats and it's value after common transformations.

    Returns string

Methods

  • Returns true if this approximates the number.

    Parameters

    • n: number

    Returns boolean

  • A dictionary with the exponents of 60 and their coefficents, which add up to this number.

    Returns string[]

  • Babylonian fraction as a calc string.

    Returns string

  • Returns the smallest integer equal to or greater than.

    Returns bigint

  • Returns the integers representing the continued fraction.

    Returns Generator<number, any, unknown>

  • Continued fraction as a string.

    Returns string

  • Returns the dot product of this and that.

    Parameters

    Returns bigint

  • A list of unit fractions which add up to this number.

    Returns Rat[]

  • Egyptian fraction as a calc string.

    Returns string

  • Returns true if this equals that.

    Parameters

    Returns boolean

  • Returns the largest integer equal to or smaller than.

    Returns bigint

  • The reciprocal, or multiplicative inverse, of this.

    Returns Rat

  • Returns true if this is a finite number.

    Returns boolean

  • Returns true if this is greater than that.

    Parameters

    Returns boolean

  • Returns true if this is less than that.

    Parameters

    Returns boolean

  • Returns true if this is less than zero.

    Returns boolean

  • Mixed fraction as a string.

    Returns string

  • Normalize the numerator and denominator by factoring out the common denominators.

    Returns void

  • Returns an array of the prime factors with their exponents.

    Returns [bigint, bigint][]

  • Prime factorization as a calc string.

    Returns string

  • Returns the nth root, a number which approximates this when multiplied by itself n times.

    Parameters

    • n: number

    Returns Rat

  • Return the closest integer approximation.

    Returns bigint

  • The text representation.

    Returns string

  • The decimal approximation.

    Returns number

Generated using TypeDoc