Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v.n() function blows up when v is a vector #1294

Closed
jasongrout opened this issue Nov 27, 2007 · 3 comments
Closed

v.n() function blows up when v is a vector #1294

jasongrout opened this issue Nov 27, 2007 · 3 comments

Comments

@jasongrout
Copy link
Member

sage: v=vector(QQ,[1,2,3])
sage: v.n()
---------------------------------------------------------------------------
<type 'exceptions.TypeError'>             Traceback (most recent call last)

/home/grout/sage/devel/sage-main/sage/graphs/<ipython console> in <module>()

/home/grout/sage/devel/sage-main/sage/graphs/element.pyx in sage.structure.element.Element.n()

/home/grout/sage/local/lib/python2.5/site-packages/sage/misc/functional.py in numerical_approx(x, prec, digits)
    731             return sage.rings.real_mpfr.RealField(prec)(x)
    732         except TypeError:
--> 733             return sage.rings.complex_field.ComplexField(prec)(x)
    734
    735 n = numerical_approx

/home/grout/sage/local/lib/python2.5/site-packages/sage/rings/complex_field.py in __call__(self, x, im)
    179             except AttributeError:
    180                 pass
--> 181         return complex_number.ComplexNumber(self, x, im)
    182
    183     def _coerce_impl(self, x):

/home/grout/sage/devel/sage-main/sage/graphs/complex_number.pyx in sage.rings.complex_number.ComplexNumber.__init__()

<type 'exceptions.TypeError'>: unable to coerce to a ComplexNumber

I'm not sure what it should do, but maybe call n() on each entry would make sense.

Component: linear algebra

Issue created by migration from https://trac.sagemath.org/ticket/1294

@mwhansen
Copy link
Contributor

Attachment: 1294.patch.gz

@mwhansen mwhansen assigned mwhansen and unassigned williamstein Dec 22, 2007
@rlmill rlmill mannequin added the s: needs review label Dec 22, 2007
@ncalexan
Copy link
Mannequin

ncalexan mannequin commented Jan 20, 2008

comment:4

Frustrating that the same snippet of code is duplicated, but this is the correct way to fix this. Apply.

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Jan 21, 2008

comment:5

Merged in Sage 2.10.1.alpha1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants