RPA JS 扩展开发文档

RPA JS 扩展开发文档

  • SDK接口说明
  • 代码示例

xsy-breeze-ui-rpa > BigNumber > exponentiatedBy

BigNumber.exponentiatedBy() method

Returns a BigNumber whose value is the value of this BigNumber exponentiated by n, i.e. raised to the power n, and optionally modulo a modulus m.

If n is negative the result is rounded according to the current DECIMAL_PLACES and ROUNDING_MODE settings.

As the number of digits of the result of the power operation can grow so large so quickly, e.g. 123.456**10000 has over 50000 digits, the number of significant digits calculated is limited to the value of the POW_PRECISION setting (unless a modulus m is specified).

By default POW_PRECISION is set to 0. This means that an unlimited number of significant digits will be calculated, and that the method's performance will decrease dramatically for larger exponents.

If m is specified and the value of m, n and this BigNumber are integers and n is positive, then a fast modular exponentiation algorithm is used, otherwise the operation will be performed as x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0.

Throws if n is not an integer.

Math.pow(0.7, 2)                    // 0.48999999999999994
x = new BigNumber(0.7)
x.exponentiatedBy(2)                // '0.49'
BigNumber(3).exponentiatedBy(-2)    // '0.11111111111111111111'

Signature:

exponentiatedBy(n: Value, m?: Value): BigNumber;

Parameters

ParameterTypeDescription
nValue
mValue

Returns:

BigNumber

Last updated on 12/16/2020
  • BigNumber.exponentiatedBy() method
  • Parameters
Copyright © 2021 销售易