Class MyMathAbstract

Reimplementation of the built-in Math object

Methods

Auxiliary Methods

Methods

  • Absolute value

    $$|x| ≝ \begin{cases} -x, & \text{if } x < 0 \\ x, & \text{otherwise} \end{cases}$$

    Parameters

    • x: number

    Returns number

  • Exponential function

    $$\exp(x) ≝ \sum_{n = 0}^\infty \frac{x^n}{n!}$$

    Parameters

    • x: number

    Returns number

Auxiliary Methods

  • Summation

    $$\begin{align} \sum_{i = m}^n f(i) &≝ f(m) + f(m + 1) + \cdots + f(n) \\ \sum_{i = m}^\infty f(i) &≝ \lim_{n \to \infty} \sum_{i = m}^n f(i) \end{align}$$

    Parameters

    • f: ((i: number) => number)
        • (i): number
        • Parameters

          • i: number

          Returns number

    • m: number
    • n: number

    Returns number

  • Product

    $$\begin{align} \prod_{i = m}^n f(i) &≝ f(m) f(m + 1) \cdots f(n) \\ \prod_{i = m}^\infty f(i) &≝ \lim_{n \to \infty} \prod_{i = m}^n f(i) \end{align}$$

    Parameters

    • f: ((i: number) => number)
        • (i): number
        • Parameters

          • i: number

          Returns number

    • m: number
    • n: number

    Returns number

  • Factorial

    $$n! ≝ \prod_{i = 1}^n i$$

    Parameters

    • n: number

    Returns number

  • Limit

    $$\lim_{n \to \infty} f(n)$$

    Parameters

    • f: ((n: number) => number)
        • (n): number
        • Parameters

          • n: number

          Returns number

    Returns number