11.07.2015 Views

Fixed and Arbitrary Precision Numerical Fields - Sage

Fixed and Arbitrary Precision Numerical Fields - Sage

Fixed and Arbitrary Precision Numerical Fields - Sage

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Sage</strong> Reference Manual: <strong>Fixed</strong> <strong>and</strong> <strong>Arbitrary</strong> <strong>Precision</strong> <strong>Numerical</strong> <strong>Fields</strong>, Release 6.2sage: RealField(100000)Real Field with 100000 bits of precisionHere we show the effect of rounding:sage: R17d = RealField(17,rnd=’RNDD’)sage: a = R17d(1)/R17d(3); a.exact_rational()87381/262144sage: R17u = RealField(17,rnd=’RNDU’)sage: a = R17u(1)/R17u(3); a.exact_rational()43691/131072Note: The default precision is 53, since according to the MPFR manual: ‘mpfr should be able to exactlyreproduce all computations with double-precision machine floating-point numbers (double type in C), exceptthe default exponent range is much wider <strong>and</strong> subnormal numbers are not implemented.’class sage.rings.real_mpfr.RealField_classBases: sage.rings.ring.FieldAn approximation to the field of real numbers using floating point numbers with any specified precision. Answersderived from calculations in this approximation may differ from what they would be if those calculationswere performed in the true field of real numbers. This is due to the rounding errors inherent to finite precisioncalculations.See the documentation for the module sage.rings.real_mpfr for more details.algebraic_closure()Return the algebraic closure of self, i.e., the complex field with the same precision.EXAMPLES:sage: RR.algebraic_closure()Complex Field with 53 bits of precisionsage: RR.algebraic_closure() is CCTruesage: RealField(100,rnd=’RNDD’).algebraic_closure()Complex Field with 100 bits of precisionsage: RealField(100).algebraic_closure()Complex Field with 100 bits of precisioncatalan_constant()Returns Catalan’s constant to the precision of this field.EXAMPLES:sage: RealField(100).catalan_constant()0.91596559417721901505460351493characteristic()Returns 0, since the field of real numbers has characteristic 0.EXAMPLES:sage: RealField(10).characteristic()0complex_field()Return complex field of the same precision.EXAMPLES:28 Chapter 2. <strong>Arbitrary</strong> <strong>Precision</strong> Real Numbers

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!