#17996: Missing Source in numerical_approx??
-----------------------------+----------------------------
Reporter: vbraun | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.6
Component: documentation | Keywords:
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
-----------------------------+----------------------------
{{{
sage: GaussianIntegers = NumberField(x^2+1, 'I').ring_of_integers()
sage: A = GaussianIntegers([2,1])
sage: A.n??
Type: builtin_function_or_method
String form: <built-in method numerical_approx of
sage.rings.number_field.number_field_element_quadratic.OrderElement_quadratic
object at 0x7f28be1b5410>
Docstring:
Return a numerical approximation of x with at least prec bits of
precision.
EXAMPLES:
sage: (2/3).n()
0.666666666666667
sage: pi.n(digits=10) # indirect doctest
3.141592654
sage: pi.n(prec=20) # indirect doctest
3.1416
TESTS:
Check that http://trac.sagemath.org/14778 is fixed:
sage: (0).n(algorithm='foo')
0.000000000000000
Init docstring: x.__init__(...) initializes x; see help(type(x)) for
signature
}}}
Note that the actual code is missing, it only shows the docstring. But
`sage_getsource` does include the method body::
{{{
sage: print sage.misc.sageinspect.sage_getsource(A.n)
def numerical_approx(self, prec=None, digits=None, algorithm=None):
"""
Return a numerical approximation of x with at least prec bits of
precision.
EXAMPLES::
sage: (2/3).n()
0.666666666666667
sage: pi.n(digits=10) # indirect doctest
3.141592654
sage: pi.n(prec=20) # indirect doctest
3.1416
TESTS:
Check that :trac:`14778` is fixed::
sage: (0).n(algorithm='foo')
0.000000000000000
"""
from sage.misc.functional import numerical_approx
return numerical_approx(self, prec=prec, digits=digits,
algorithm=algorithm)
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/17996>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.