## Expressing a decimal as a fraction in lowest terms

14

2

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

8Rationalize[0.1845095405274387, 10^-50] ? – Dr. belisarius – 2012-06-20T01:07:31.600

9

Another option:

RootApproximant[0.1845095405274387, 1]


8

Still another possibility:

Last[Convergents[0.1845095405274387]]


1+1 for referencing a non-esoteric function I cannot recall using. – Mr.Wizard – 2012-06-22T02:02:38.673

I deal with continued fractions somewhat frequently, you see... – J. M.'s ennui – 2012-06-22T02:04:02.633

7

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 – 2012-06-20T02:08:55.970