6.5.1.1 RealField Objects

class RealField
Instances of class RealField have the following methods (in addition to inherited methods and special methods):

characteristic,$  $ euler_constant,$  $ factorial,$  $ is_atomic_repr,$  $ is_finite,$  $ log2,$  $ name,$  $ pi,$  $ precision,$  $ rounding_mode,$  $ scientific_notation

Further documentation:

characteristic( )

Returns 0, since the field of real numbers has characteristic 0.

sage: RealField(10).characteristic()
0

euler_constant( )

Returns Euler's gamma constant to the precision of this field.

sage: RealField(100).euler_constant()
0.57721566490153286060651209008234

factorial( )

Return the factorial of the integer n as a real number.

is_atomic_repr( )

Returns True, to signify that elements of this field print without sums, so parenthesis aren't required, e.g., in coefficients of polynomials.

sage: RealField(10).is_atomic_repr()
True

is_finite( )

Returns False, since the field of real numbers is not finite.

sage: RealField(10).is_finite()
False

log2( )

Returns log(2) to the precision of this field.

sage: R=RealField(100)
sage: R.log2() 
0.69314718055994530941723212145798
sage: R(2).log()
0.69314718055994530941723212145798

pi( )

Returns pi to the precision of this field.

sage: R = RealField(100)
sage: R.pi()
3.1415926535897932384626433832793
sage: R.pi().sqrt()/2
0.88622692545275801364908374167063

scientific_notation( )

Set or return the scientific notation printing flag. If this flag is true then real numbers with this space as parent print using scientific notation.

INPUT:
    status -- optional flag

Instances of class RealField also have the following special methods:

__call__,$  $ __cmp__,$  $ __reduce__,$  $ __repr__,$  $ _coerce_

Further documentation:

__reduce__( )

Needed for object persistence.

See About this document... for information on suggesting changes.