Function bigint #

Create a bigint or convert a string, boolean, or unit to a bigint. When value is a matrix, all elements will be converted to bigint.

Syntax #

math.bigint(value)

Parameters #

Parameter Type Description
value string | number | BigNumber | bigint | Fraction | boolean | Array | Matrix | null Value to be converted

Returns #

Type Description
bigint | Array | Matrix The created bigint

Throws #

Type | Description —- | ———–

Examples #

math.bigint(2)                         // returns 2n
math.bigint('123')                     // returns 123n
math.bigint(true)                      // returns 1n
math.bigint([true, false, true, true]) // returns [1n, 0n, 1n, 1n]

See also #

number, bignumber, boolean, complex, index, matrix, string, unit

Fork me on GitHub