RPA JS 扩展开发文档

RPA JS 扩展开发文档

  • SDK接口说明
  • 代码示例

xsy-breeze-ui-rpa > BigNumber > mod

BigNumber.mod() method

Returns a BigNumber whose value is the value of this BigNumber modulo n, i.e. the integer remainder of dividing this BigNumber by n.

The value returned, and in particular its sign, is dependent on the value of the MODULO_MODE setting of this BigNumber constructor. If it is 1 (default value), the result will have the same sign as this BigNumber, and it will match that of Javascript's % operator (within the limits of double precision) and BigDecimal's remainder method.

The return value is always exact and unrounded.

See MODULO_MODE for a description of the other modulo modes.

1 % 0.9                      // 0.09999999999999998
x = new BigNumber(1)
x.mod(0.9)                   // '0.1'
y = new BigNumber(33)
y.mod('a', 33)               // '3'

Signature:

mod(n: Value, base?: number): BigNumber;

Parameters

ParameterTypeDescription
nValue
basenumber

Returns:

BigNumber

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