This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / Built-in Functions / Numerical Computation / Number Representation /


FilledSmallSquare Rationalize[x] takes Real numbers in x that are close to rationals, and converts them to exact Rational numbers.

FilledSmallSquare Rationalize[x, dx] performs the conversion whenever the error made is smaller in magnitude than dx.

FilledSmallSquare Example: Rationalize[3.78] LongRightArrow.

FilledSmallSquare Rationalize[x, dx] yields the rational number with the smallest denominator that lies within dx of x.

FilledSmallSquare Rationalize[N[Pi]] LongRightArrow does not give a rational number, since there is none "sufficiently close" to N[Pi].

FilledSmallSquare A rational number is considered "sufficiently close" to a Real if , where is chosen to be .

FilledSmallSquare Rationalize[x, 0] converts any x to rational form.

FilledSmallSquare See Section 3.2.2.

FilledSmallSquare See also: Chop, Round, ContinuedFraction, LatticeReduce.

FilledSmallSquare Related package: NumberTheory`Rationalize`.

FilledSmallSquare New in Version 1.

Further Examples