Skip to content

bigIntDigitCount

bigIntDigitCount(value, radix?): number

Defined in: big-int/digit-count.ts:16

How many digits |value| takes in radix — 1 for zero, which still reads as one digit.

Base ten goes through bigIntLog10, which is O(log log n); any other radix has no such shortcut and materialises the numeral, which is O(n²/k) in the digit count.

bigint

The value to measure. Its sign is ignored.

number = 10

The base, from 2 to 36. Defaults to 10.

number

The digit count, at least one.

If radix is not an integer in [2, 36].