Function nthRoot

  • Calculates the nth root of a number.

    Parameters

    • base: number

      The base number.

    • root: number

      The root to calculate.

    Returns number

    The result of calculating the nth root.

    Example

    const result = nthRoot(27, 3);
    console.log(result);
    // Output: 3
  • Calculates the nth root of a bigint.

    Parameters

    • base: bigint

      The base bigint.

    • root: number

      The root to calculate.

    Returns bigint

    The result of calculating the nth root.

    Example

    const result = nthRoot(BigInt(27), 3);
    console.log(result);
    // Output: 3n

Generated using TypeDoc