Ask Your Question
1

SAGE digits!!!

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

Sagud gravatar image

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

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 +0200

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 +0200 )edit

And you get 2 for it as well :-)

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

Seen: 901 times

Last updated: Apr 06 '11