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.

Details

  • Rationalize[x,dx] works with exact numbers x.
  • Rationalize[x] yields x unchanged if there is no rational number close enough to x to satisfy the condition , with chosen to be .
  • Rationalize[x,0] converts any x to rational form. »

Examples

open allclose all

Basic Examples  (1)

Convert to a rational number:

In[1]:=
Click for copyable input
Out[1]=

Scope  (5)

Applications  (3)

Properties & Relations  (3)

See Also

N  Chop  Round  ContinuedFraction  Convergents  RootApproximant  LatticeReduce  FindSequenceFunction

Tutorials

Introduced in 1988
(1.0)
| Updated in 1999
(4.0)