Function powBig

  • Raises a Big number to the power of another Big number.

    Parameters

    • big: Big

      The base Big number.

    • exp: number = 2

      The exponent (non-negative integer). Defaults to 2.

    • Optional mutable: boolean = false

      Whether to mutate the first Big instance. Defaults to false.

    Returns Big

    • The result of a raised to the power of b.

    Throws

    • If the exponent is not a non-negative integer.

    Example

    powBig(new Big(2), 0); // new Big instance with value 1
    powBig(new Big(2), 1); // new Big instance with value 2
    powBig(new Big(2), 3); // new Big instance with value 8
    powBig(new Big(2), 3.3); // throws Error
    powBig(new Big(2), -3); // throws Error

Generated using TypeDoc