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.2rounding_mode()Return the rounding mode.EXAMPLES:sage: RR.rounding_mode()’RNDN’sage: RealField(20,rnd=’RNDZ’).rounding_mode()’RNDZ’sage: RealField(20,rnd=’RNDU’).rounding_mode()’RNDU’sage: RealField(20,rnd=’RNDD’).rounding_mode()’RNDD’scientific_notation(status=None)Set or return the scientific notation printing flag. If this flag is True then real numbers with this space asparent print using scientific notation.INPUT:•status – boolean optional flagEXAMPLES:sage: RR.scientific_notation()Falsesage: elt = RR(0.2512); elt0.251200000000000sage: RR.scientific_notation(True)sage: elt2.51200000000000e-1sage: RR.scientific_notation()Truesage: RR.scientific_notation(False)sage: elt0.251200000000000sage: R = RealField(20, sci_not=1)sage: R.scientific_notation()Truesage: R(0.2512)2.5120e-1to_prec(prec)Return the real field that is identical to self, except that it has the specified precision.EXAMPLES:sage: RR.to_prec(212)Real Field with 212 bits of precisionsage: R = RealField(30, rnd="RNDZ")sage: R.to_prec(300)Real Field with 300 bits of precision <strong>and</strong> rounding RNDZzeta(n=2)Return an n-th root of unity in the real field, if one exists, or raise a ValueError otherwise.EXAMPLES:sage: R = RealField()sage: R.zeta()-1.00000000000000sage: R.zeta(1)32 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!