Function bignumber #
Create a BigNumber, which can store numbers with arbitrary precision. When a matrix is provided, all elements will be converted to BigNumber.
Syntax #
math.bignumber(x)
Parameters #
Parameter | Type | Description |
---|---|---|
value |
number | string | Fraction | BigNumber | Array | Matrix | boolean | null | Value for the big number, 0 by default. |
Returns #
Type | Description |
---|---|
BigNumber | The created bignumber |
Throws #
Type | Description —- | ———–
Examples #
0.1 + 0.2 // returns number 0.30000000000000004
math.bignumber(0.1) + math.bignumber(0.2) // returns BigNumber 0.3
7.2e500 // returns number Infinity
math.bignumber('7.2e500') // returns BigNumber 7.2e500