• Rationalize[x] takes Real numbers in x that are close to rationals, and converts them to exact Rational numbers.
• Rationalize[x, dx] performs the conversion whenever the error made is smaller in magnitude than dx.
• Example: Rationalize[3.78]
• Rationalize[x, dx] yields the rational number with the smallest denominator that lies within dx of x.
does not give a rational number, since there is none "sufficiently close" to N[Pi]
• A rational number
is considered "sufficiently close" to a Real
is chosen to be
• Rationalize[x, 0] converts any x to rational form.
• New in Version 1.