Skip to content

bigIntDigitAt

bigIntDigitAt(value, position, radix?): number

Defined in: big-int/digit-at.ts:22

The digit of |value| at position, counting powers of radix from zero — 0 is the units digit, 2 the hundreds in base ten.

0 for any position the value does not reach, which makes a numeral’s leading zeros indistinguishable from absent ones, as they are. Negative positions are below the units digit and so always 0, an integer having nothing there.

O(position) big-integer work, since reaching the digit means dividing by radix ** position.

bigint

The value to read. Its sign is ignored.

number

The power of radix to read.

number = 10

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

number

A digit from 0 to radix - 1.

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