n() returns symbolic expression

6 views
Skip to first unread message

Håkan Granath

unread,
Sep 12, 2010, 7:06:12 AM9/12/10
to sage-support
Sometimes n() returns a symbolic expression:

----------------------------------------------------------------------
| Sage Version 4.5.3, Release Date: 2010-09-04 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: a=(sqrt(4*(sqrt(3) - 5)*(sqrt(3) + 5) + 48) + 4*sqrt(3))/
(sqrt(3) + 5)
sage:
a.imag().n()
0.939469338708203*sin(0.500000000000000*pi)

The expected output would, of course, be 0.939469338708203

Regards,

/Håkan Granath

Paul Zimmermann

unread,
Sep 15, 2010, 10:00:30 PM9/15/10
to sage-s...@googlegroups.com
this is now in trac: http://trac.sagemath.org/sage_trac/ticket/9913

Paul Zimmermann

TianWei

unread,
Sep 16, 2010, 7:16:27 PM9/16/10
to sage-support
> sage: a=(sqrt(4*(sqrt(3) - 5)*(sqrt(3) + 5) + 48) + 4*sqrt(3))/
> (sqrt(3) + 5)
> sage:
> a.imag().n()
> 0.939469338708203*sin(0.500000000000000*pi)

Here's a simpler example:

sage: b = sqrt(-log(2))
sage: print b.imag().n()
0.832554611157698*sin(0.500000000000000*pi)

-- Tianwei
Reply all
Reply to author
Forward
0 new messages