Skip to main content

precision - 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.2``2;
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?




Comments