This works:

sage: emb = B.parent().complex_embeddings()[0]
sage: emb(B)
-6.5 + 11.2583302492*I

B is an element of a number field:
sage: B.parent()
Cyclotomic Field of order 6 and degree 2

and number fields have several embeddings into CC (in this case, 2):
sage: len( B.parent().complex_embeddings())
2

You have complete control over precision:
sage: emb = B.parent().complex_embeddings(prec=200)[0]
sage: emb(B)
-6.5000000000000000000000000000000000000000000000000000000000 +
11.258330249197702407928401219788170385128234149767474082363*I

John Cremona

2008/9/24 Raouf <[EMAIL PROTECTED]>:
>
> Hi,
> I want to have a numerical value of a  Dirichlet character :
>
> I have this line code in my notebook:
>
> sage:
> G = DirichletGroup(21)
> chi = G.1;
> chi(23)
>
> evaluate:
> zeta6 - 1
>
> And when i want to use this value: zeta6 - 1 i have the error message:
>
> G = DirichletGroup(21)
> chi = G.1;
> chi(23)
> B=13*chi(23)
> print float(B)
>
> error message:
>
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/home/server2/nb1/sage_notebook/worksheets/fstthese/0/code/
> 6.py", line 10, in <module>
>    print float(B)
>  File "/home/server2/sage/local/lib/python2.5/site-packages/
> SQLAlchemy-0.4.6-py2.5.egg/", line 1, in <module>
>
> TypeError: float() argument must be a string or a number.
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to