Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

Another option:

RootApproximant[0.1845095405274387, 1]
share|improve this answer

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

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

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.