#9032: no method numerical_approx for integers and rationals
--------------------------------+-------------------------------------------
Reporter: zimmerma | Owner: AlexGhitza
Type: defect | Status: new
Priority: major | Milestone: sage-4.4.3
Component: basic arithmetic | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
--------------------------------+-------------------------------------------
{{{
sage: a=8
sage: a.n()
8.00000000000000
sage: a.numerical_approx()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call
last)
/home/zimmerma/<ipython console> in <module>()
/usr/local/sage-4.4.2/sage/local/lib/python2.6/site-
packages/sage/structure/element.so in
sage.structure.element.Element.__getattr__
(sage/structure/element.c:2628)()
/usr/local/sage-4.4.2/sage/local/lib/python2.6/site-
packages/sage/structure/parent.so in
sage.structure.parent.getattr_from_other_class
(sage/structure/parent.c:2828)()
/usr/local/sage-4.4.2/sage/local/lib/python2.6/site-
packages/sage/structure/parent.so in
sage.structure.parent.raise_attribute_error
(sage/structure/parent.c:2595)()
AttributeError: 'sage.rings.integer.Integer' object has no attribute
'numerical_approx'
}}}
The same holds for a=17/2 for example.
Since {{{n}}} is a shortcut for {{{numerical_approx}}},
it should work with {{{numerical_approx}}} too. In addition,
if one uses a variable {{{n}}} is a program, it would be more
portable to use {{{numerical_approx}}}.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9032>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.