Mathematica 9 is now available
 Documentation / Mathematica / Built-in Functions / Numerical Computation / Number Representation  /
Rationalize

  • 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[N[Pi]] 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 if , where is chosen to be .
  • Rationalize[ x , 0] converts any x to rational form.
  • See the Mathematica book: Section 3.1.3.
  • See also: Chop, Round, LatticeReduce.
  • Related package: NumberTheory`Rationalize`, NumberTheory`ContinuedFractions`.


    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.