This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# RealDigits

 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. RealDigitsgives a list of base-b digits in x. RealDigitsgives a list of len digits. RealDigitsgives len digits starting with the coefficient of .
• RealDigits gives the most significant digits first, as in standard positional notation.
• For integers and rational numbers with terminating digit expansions, RealDigits[x] returns an ordinary list of digits. For rational numbers with non-terminating digit expansions, it yields a list of the form representing the digit sequence consisting of the followed by infinite cyclic repetitions of the . »
• RealDigits starts with the digit which is the coefficient of , truncating or padding with zeros as necessary. »
• RealDigits starts with the digit immediately to the right of the base-b decimal point in x.
• The base b in RealDigits need not be an integer. For any real b such that b>1, RealDigits successively finds the largest integer multiples of powers of b that can be removed while leaving a non-negative remainder.
Give the list of digits and exponent:
Give 25 digits of in base 10:
Give 25 digits of :
Give an explicit recurring decimal form:
Give the list of digits and exponent:
 Out[1]=
 Out[2]=

Give 25 digits of in base 10:
 Out[1]=

Give 25 digits of :
 Out[1]=
Give an explicit recurring decimal form:
 Out[2]=
 Scope   (3)
Base-2 digits:
20 digits starting with the coefficient of :
20 digits starting with the coefficient of :
Noninteger bases are allowed:
RealDigits gives Indeterminate if more digits than the precision are requested:
Start at the coefficient of :
Include only digits that are determined by the precision available:
 Applications   (6)
The 10000 digit of is an 8:
Number of 1s in the first million base-2 digits of :
Distribution of first 100000 digits of in base 47:
Fibonacci representations of integers:
Binary representation of a machine number:
is equal to the number of bits times :
Get the next larger machine number:
The spacing between these numbers is \$MachineEpsilon:
Find the error in representing with a machine number:
The next smaller machine number is farther away:
The default number of digits returned is determined by the precision of the number:
Digits unknown at the available precision are filled in as Indeterminate:
For non-binary bases, the digits given may not be enough to reconstruct the number exactly:
More than Round decimal digits are required to separate x from 1:
InputForm uses a sufficient number of digits to uniquely reconstruct the number:
A hundred digits of starting with the millionth digit: