Mathematica 9 is now available

IntegerDigits

Usage

IntegerDigits[n] gives a list of the decimal digits in the integer n.
IntegerDigits[n, b] gives a list of the base-b digits in the integer n.
IntegerDigits[n, b, len] pads the list on the left with zeros to give a list of length len.


Notes

• Examples: IntegerDigits[5810]LongRightArrow ; IntegerDigits[5810, 16]LongRightArrow .
IntegerDigits[n] discards the sign of n.
• If len is less than the number of digits in n then the len least significant digits are returned.
IntegerDigits[0] gives {0}.
FromDigits can be used as the inverse of IntegerDigits.
• See Section 3.1.3.
• Implementation notes: see Section A.9.4.
• New in Version 2; modified in 3.


Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.