# Expressing a decimal as a fraction in lowest terms

How can I express a decimal such as 0.1845095405274387 as a fraction in its lowest terms?

• Rationalize[0.1845095405274387, 10^-50] ? – Dr. belisarius Jun 20 '12 at 1:07

## 3 Answers

Another option:

RootApproximant[0.1845095405274387, 1]


Still another possibility:

Last[Convergents[0.1845095405274387]]

• +1 for referencing a non-esoteric function I cannot recall using. – Mr.Wizard Jun 22 '12 at 2:02
• I deal with continued fractions somewhat frequently, you see... – J. M. will be back soon Jun 22 '12 at 2:04

A couple of bits of code for your consideration:

FromDigits@#/10^(Length@# - #2) & @@ RealDigits[0.1845095405274387]

Rationalize[0.1845095405274387, \$MachineEpsilon]

• @Mr.Wizard...I Thank you – emmett Jun 20 '12 at 2:08