On May 31, 2:15 pm, William Stein <wst...@gmail.com> wrote: > On Sun, May 31, 2009 at 6:28 AM, jyr <jyr2...@googlemail.com> wrote: > > > Hi, > > > There is something strange going on with the simple sqrt() function: > > > sage: sqrt(2) > > sqrt(2) > > sage: sqrt(2.0) > > 1.41421356237310 > > sage: sqrt(2,prec=100) > > 1.4142135623730950488016887242 > > > but: > > > sage: sqrt(2.0,prec=100) > > --------------------------------------------------------------------------- > > TypeError Traceback (most recent call > > last) > > ... > > TypeError: sqrt() got an unexpected keyword argument 'prec' > > > You also get the above result if you use a symbolic variable instead, > > eg x=2.0 > > Similarly: > > > sage: sqrt(pi) > > sqrt(pi) > > sage: sqrt(pi,prec=100) > > --------------------------------------------------------------------------- > > TypeError Traceback (most recent call > > last) > > ... > > TypeError: sqrt() takes no keyword arguments > > > The latter used to work in 3.4.2 and is now broken in the latest 4.0 > > 32-bit Intel build. > > > I suppose this should work tranparently or should the sqrt() function > > be used in a different way? > > I recommend doing this: > > sage: N(sqrt(pi), prec=100) > 1.7724538509055160272981674833 > sage: sqrt(pi).numerical_approx(prec=100) > 1.7724538509055160272981674833 > > -- William
Now see also <http://trac.sagemath.org/sage_trac/ticket/6171>. John --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---