15

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

F'x
  • 10,817
  • 3
  • 52
  • 92
emmett
  • 359
  • 1
  • 2
  • 5

3 Answers3

9

Another option:

RootApproximant[0.1845095405274387, 1]
Simon Woods
  • 84,945
  • 8
  • 175
  • 324
8

Still another possibility:

Last[Convergents[0.1845095405274387]]
J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
7

A couple of bits of code for your consideration:

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

Rationalize[0.1845095405274387, $MachineEpsilon]
Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371