Mathematica >

Rationalize

Rationalize[x]
converts an approximate number x to a nearby rational with small denominator.
Rationalize[x, dx]
yields the rational number with smallest denominator that lies within dx of x.
  • Rationalize[x] yields x unchanged if there no rational number close enough to x to satisfy the condition VerticalSeparatorp/q-xVerticalSeparator<c/q2, with c chosen to be 10-4.
New in 1 | Last modified in 4
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team