This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / Built-in Functions / Numerical Computation / Number Representation /

IntegerDigits

FilledSmallSquare IntegerDigits[n] gives a list of the decimal digits in the integer n.

FilledSmallSquare IntegerDigits[n, b] gives a list of the base-b digits in the integer n.

FilledSmallSquare IntegerDigits[n, b, len] pads the list on the left with zeros to give a list of length len.

FilledSmallSquare Examples: IntegerDigits[5810] LongRightArrow; IntegerDigits[5810, 16] LongRightArrow.

FilledSmallSquare IntegerDigits[n] discards the sign of n.

FilledSmallSquare If len is less than the number of digits in n then the len least significant digits are returned.

FilledSmallSquare IntegerDigits[0] gives {0}.

FilledSmallSquare FromDigits can be used as the inverse of IntegerDigits.

FilledSmallSquare See Section 3.1.3.

FilledSmallSquare Implementation Notes: see Section A.9.4.

FilledSmallSquare See also: DigitCount, RealDigits, BaseForm, NumberForm, FromDigits, IntegerExponent, IntegerPart, ContinuedFraction.

FilledSmallSquare New in Version 2; modified in 3.

Further Examples