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.2is_negative_infinity()Check if self is −∞.EXAMPLES:sage: a = RDF(2)/RDF(0)sage: a.is_negative_infinity()Falsesage: a = RDF(-3)/RDF(0)sage: a.is_negative_infinity()Trueis_positive_infinity()Check if self is +∞.EXAMPLES:sage: a = RDF(1)/RDF(0)sage: a.is_positive_infinity()Truesage: a = RDF(-1)/RDF(0)sage: a.is_positive_infinity()Falseis_square()Return whether or not this number is a square in this field. For the real numbers, this is True if <strong>and</strong> onlyif self is non-negative.EXAMPLES:sage: RDF(3.5).is_square()Truesage: RDF(0).is_square()Truesage: RDF(-4).is_square()Falselog(base=None)Return the logarithm.INPUT:•base – integer or None (default). The base of the logarithm. If None is specified, the base is e (theso-called natural logarithm).OUTPUT:The logarithm of self. If self is positive, a double floating point number. Infinity if self is zero. Aimaginary complex floating point number if self is negative.EXAMPLES:sage: RDF(2).log()0.69314718056sage: RDF(2).log(2)1.0sage: RDF(2).log(pi)0.605511561398sage: RDF(2).log(10)0.301029995664sage: RDF(2).log(1.5)1.7095112913510 Chapter 1. Double <strong>Precision</strong> Real Numbers

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

Saved successfully!

Ooh no, something went wrong!