Mathematica 9 is now available

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

Rationalize

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



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.