Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

share|improve this question
4  
Rationalize[0.1845095405274387, 10^-50] ? –  belisarius Jun 20 '12 at 1:07
add comment

3 Answers 3

Another option:

RootApproximant[0.1845095405274387, 1]
share|improve this answer
add comment

Still another possibility:

Last[Convergents[0.1845095405274387]]
share|improve this answer
1  
+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. Jun 22 '12 at 2:04
add comment

A couple of bits of code for your consideration:

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

Rationalize[0.1845095405274387, $MachineEpsilon]
share|improve this answer
    
@Mr.Wizard...I Thank you –  emmett Jun 20 '12 at 2:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.