6.5.2.1 RealNumber Objects

class RealNumber
A real number.
Instances of class RealNumber have the following methods (in addition to inherited methods and special methods):

acos,$  $ acosh,$  $ agm,$  $ asin,$  $ asinh,$  $ atan,$  $ atanh,$  $ ceil,$  $ copy,$  $ cos,$  $ cosh,$  $ cube_root,$  $ erf,$  $ exp,$  $ exp10,$  $ exp2,$  $ floor,$  $ frac,$  $ gamma,$  $ log,$  $ log10,$  $ log2,$  $ parent,$  $ prec,$  $ real,$  $ round,$  $ sign,$  $ sin,$  $ sincos,$  $ sinh,$  $ sqrt,$  $ str,$  $ tan,$  $ tanh,$  $ trunc,$  $ zeta

Further documentation:

agm( )

Return the arithmetic-geometric mean of self and other. The arithmetic-geometric mean is the common limit of the sequences $ u_n$ and $ v_n$ , where $ u_0$ is self, $ v_0$ is other, $ u_{n+1}$ is the arithmetic mean of $ u_n$ and $ v_n$ , and $ v_{n+1}$ is the geometric mean of u_n and v_n. If any operand is negative, the return value is codeNaN.

cube_root( )

Return the cubic root (defined over the real numbers) of self.

erf( )

Returns the value of the error function on self.

sage: R = RealField()                                                
sage: R(6).erf()
1.0000000000000000

frac( )

frac returns a real number > -1 and < 1. it satisfies the relation: x = x.trunc() + x.frac()

gamma( )

The Euler gamma function. Return gamma of self.

sage: R = RealField()                                                
sage: R(6).gamma()
120.00000000000000
sage: R(1.5).gamma()
0.88622692545275805

log( )

sage: R = RealField()
sage: R(2).log()
0.69314718055994529

parent( )

sage: R = RealField()
sage: a = R('1.2456')
sage: a.parent()
Real Field with 53 bits of precision

real( )

Return the real part of self.

(Since self is a real number, this simply returns self.)

sin( )

sage: R = RealField(100)
sage: R(2).sin()
0.90929742682568169539601986591150

sincos( )

Returns a pair consisting of the sine and cosine.

sage: R = RealField()
sage: t = R.pi()/6
sage: t.sincos()
(0.49999999999999994, 0.86602540378443871)

sqrt( )

Return the square root of self.

zeta( )

The Riemann zeta function. Return zeta of self.

sage: R = RealField()                                                
sage: R(2).zeta()
1.6449340668482264
sage: R(-2).zeta()
0.00000000000000000
sage: R(1).zeta()
+infinity

Instances of class RealNumber also have the following special methods:

__abs__,$  $ __add,$  $ __add__,$  $ __cmp__,$  $ __complex__,$  $ __div,$  $ __div__,$  $ __eq__,$  $ __float__,$  $ __ge__,$  $ __gt__,$  $ __le__,$  $ __lt__,$  $ __mul,$  $ __mul__,$  $ __ne__,$  $ __neg__,$  $ __pos__,$  $ __pow,$  $ __pow__,$  $ __radd__,$  $ __rdiv__,$  $ __repr__,$  $ __rmul__,$  $ __rpow__,$  $ __rsub__,$  $ __sub,$  $ __sub__

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