Ask Your Question
1

SAGE digits!!!

asked 2011-04-05 05:29:16 -0500

Sagud gravatar image

updated 2011-05-05 08:31:55 -0500

Kelvin Li gravatar image

How can I make p.real_roots() in 6 digits??
.n(digits=6) DONT work!!!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2011-04-05 05:38:06 -0500

Shashank gravatar image
R.<x> = RealField(100)[];
a = [];
for n in range (1,11):
  p = gen_legendre_P(n, 0, x)
  print "n =", n
  print "Nultocke: ", [p.real_roots()[i].n(digits=6) for i in range(len(p.real_roots()))]
  a = p.real_roots();
edit flag offensive delete link more

Comments

If you like @chicago's answer, you can "Accept" it, and he/she gets more karma/reputation.

kcrisman gravatar imagekcrisman ( 2011-04-05 06:23:56 -0500 )edit

And you get 2 for it as well :-)

kcrisman gravatar imagekcrisman ( 2011-04-05 06:24:05 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-04-05 05:29:16 -0500

Seen: 592 times

Last updated: Apr 06 '11