Legacy Documentation

Mathematica® Teacher's Edition (2002)

This is documentation for an obsolete product.
Current products and services
 Documentation /  Mathematica Teacher's Edition /  Built-in Functions /  Numerical Computation /  Number Representation /

RealDigits

FilledSmallSquare RealDigits[x] gives a list of the digits in the approximate real number x, together with the number of digits that are to the left of the decimal point.
FilledSmallSquare RealDigits[x, b] gives a list of base-b digits in x.
FilledSmallSquare RealDigits[x, b, len] gives a list of len digits.
FilledSmallSquare RealDigits[x, b, len, n] gives len digits starting with the coefficient of .

FilledSmallSquare RealDigits[x] normally returns a list of digits whose length is equal to Precision[x].
FilledSmallSquare RealDigits[x] and RealDigits[x, b] normally require that x be an approximate real number, returned for example by N. RealDigits[x, b, len] also works on exact numbers.
FilledSmallSquare For exact rational numbers RealDigits[x] returns a list of digits of the form , , ... , , , ... representing the digits followed by infinite cyclic repetition of the .
FilledSmallSquare If len is larger than Log[10, b] Precision[x] remaining digits are filled in as Indeterminate.
FilledSmallSquare RealDigits[x, b, len, n] starts with the digit which is the coefficient of , truncating or padding with zeros as necessary.
FilledSmallSquare RealDigits[x, b, len, -1] starts with the digit immediately to the right of the base-b decimal point in x.
FilledSmallSquare The base b in RealDigits[x, b] need not be an integer. For any real b such that , RealDigits[x, b] successively finds the largest integer multiples of powers of b that can be removed while leaving a nonnegative remainder.
FilledSmallSquare RealDigits[x] discards the sign of x.
FilledSmallSquare FromDigits can be used as the inverse of RealDigits.
FilledSmallSquare See The Mathematica Book on the web: Section 3.1.3.
FilledSmallSquare See also: IntegerDigits, BaseForm, FromDigits, ContinuedFraction.