1 Properties of the BigInt Constructor
The BigInt constructor:
- has a [[Prototype]] internal slot whose value is %Function.prototype%.
- has the following properties:
1.1 BigInt.abs ( x )
This function returns the absolute value of x as a BigInt; the result has the same magnitude as x but has positive sign.
It performs the following steps when called:
- If x is not a BigInt, throw a TypeError exception.
- Return the BigInt value that represents abs(ℝ(x)).
1.2 BigInt.cbrt ( x )
This function returns the cube root of x as a BigInt.
It performs the following steps when called:
- If x is not a BigInt, throw a TypeError exception.
- Let root be the cube root of ℝ(x).
- Return ℤ(truncate(root)).
1.3 BigInt.max ( firstArg, ...restArgs )
Given one or more BigInt arguments, this function returns the largest of the resulting values.
It performs the following steps when called:
- If x is not a BigInt, throw a TypeError exception.
- Let highest be firstCoerced.
- For each element number of restCoerced, do
- If number is not a BigInt, throw a TypeError exception.
- If number > highest, set highest to number.
- Return highest.
The "length" property of this function is 2𝔽.
1.4 BigInt.min ( firstArg, ...restArgs )
Given one or more arguments, this function calls ToBigInt on each of the arguments and returns the smallest of the resulting values.
It performs the following steps when called:
- If x is not a BigInt, throw a TypeError exception.
- Let lowest be firstCoerced.
- For each element number of restCoerced, do
- If number is not a BigInt, throw a TypeError exception.
- If number < lowest, set lowest to number.
- Return lowest.
The "length" property of this function is 2𝔽.
1.5 BigInt.pow ( base, exponent )
This function performs the following steps when called:
- If base is not a BigInt, throw a TypeError exception.
- If exponent is not a BigInt, throw a TypeError exception.
- Return BigInt::exponentiate(base, exponent).
1.6 BigInt.prototype
The initial value of BigInt.prototype
is the BigInt prototype object.
This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
1.7 BigInt.sign ( x )
This function returns the sign of x as a BigInt, indicating whether x is positive, negative, or zero.
It performs the following steps when called:
- If x is not a BigInt, throw a TypeError exception.
- If x is 0ℤ, return x.
- If x < 0ℤ, return -1ℤ.
- Return 1ℤ.
1.8 BigInt.sqrt ( x )
This function returns the square root of x as a BigInt.
It performs the following steps when called:
- If x is not a BigInt, throw a TypeError exception.
- If x < 0ℤ, throw a RangeError exception.
- Let root be the square root of ℝ(x).
- Return ℤ(truncate(root)).