Ask Your Question
1

SAGE digits!!!

asked 2011-04-05 12:29:16 +0100

Sagud gravatar image

updated 2011-05-05 15:31:55 +0100

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 12:38:06 +0100

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 13:23:56 +0100 )edit

And you get 2 for it as well :-)

kcrisman gravatar imagekcrisman ( 2011-04-05 13:24:05 +0100 )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 12:29:16 +0100

Seen: 962 times

Last updated: Apr 06 '11