# Abnormal behavior of RealDigits[x]

In the Details of the document of RealDigits writes the following line:

RealDigits[x] normally returns a list of digits of length Round[Precision[x]].

Then when will RealDigits[x] abnormally return something and what will be returned?

The details has shown us one of them:

RealDigits[0.] gives {{0},-Floor[Accuracy[0.]]}.

Are there more?

The following is one I found today:

x = 1.22;
Round@Precision@x
(* 2 *)
Length@First@RealDigits@x
(* 3 *)


Is there a complete summary for the behaviors of RealDigits with only one valid argument? Does these abnormalities follow any unified rule?

## 1 Answer

test[x_] :=
With[{a = Length[First@RealDigits[x]], b = Round[Precision[x]]},
a == b
]


the test is False for any Integer and Rational, exact symbols like Pi, etc.

Its also False for N[m, n] for any m power of 10 and n been an Integer. As well as for some other Real numbers, I'm guessing depending on the internal representation.

test[N[1, 10.3]]

False