converts an approximate number x to a nearby rational with small denominator.
yields the rational number with smallest denominator that lies within dx of x.
- 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 inexact number x to rational form. »
Basic Examples (1)
Convert to a rational number:
Properties & Relations (3)
Introduced in 1988
Updated in 1999