# How to enter a repeating decimal in Mathematica

I don't understand how to manipulate numbers with repeating decimal in Wolfram Mathematica language.

For example 0.3... does not work as input and I don't see how to add a vinculum to indicate the repeating part either. There's no manual or something on the issue on the net. Something strange and unusable 0.12(34)^_ (repeating decimal) is given by Wolfram Alpha.

• It's probably easiest to just add it as a fractional term if you need arbitrary precision 12/100+(34/99)/100. Feb 25 at 1:16

Indeed, there is no direct method to input a repeating decimal. The closest you can get is to input the repeating digits into FromDigits[]:

$$0.\overline{142857}$$

FromDigits[{{{1, 4, 2, 8, 5, 7}}, 0}]
1/7


$$0.\overline{3}$$

FromDigits[{{{3}}, 0}]
1/3


$$0.1\overline{6}$$

FromDigits[{{1, {6}}, 0}]
1/6


Of course, this also applies for e.g. repeating binary representations:

$${0.000\overline{1100}}_2$$

FromDigits[{{0, 0, 0, {1, 1, 0, 0}}, 0}, 2]
1/10

• Thank you very much. Feb 25 at 2:04

Use the Resource Function

ResourceFunction["RepeatingDecimalToRational"][0.3, 1]

(* 1/3 *)