[sage-devel] Re: real number parsing issue

2008-09-23 Thread Robert Bradshaw
On Sep 9, 2008, at 9:20 AM, Robert Bradshaw wrote: > On Sep 9, 2008, at 2:30 AM, Martin Albrecht wrote: > >> >> On Tuesday 09 September 2008, William Stein wrote: On a related note, recently I wrote a simple loop that went something like this: while abs(err) < 1e-6:

[sage-devel] Re: real number parsing issue

2008-09-09 Thread Robert Bradshaw
On Sep 9, 2008, at 2:30 AM, Martin Albrecht wrote: > > On Tuesday 09 September 2008, William Stein wrote: >>> On a related note, recently I wrote a simple loop that went >>> something >>> like this: >>> >>> while abs(err) < 1e-6: >>> ... >>> >>> The most expensive part of the operation, by

[sage-devel] Re: real number parsing issue

2008-09-09 Thread Martin Albrecht
Hi, even if you have such a loop; while x > 1e-6: pass it will be preparsed to while x > RealNumber('1e-6'): pass and thus 1e-6 will be regenerated in every iteration. However, in .py files this shouldn't be an issue. I suppose you knew what I just wrote already, but it is sometimes wo

[sage-devel] Re: real number parsing issue

2008-09-09 Thread John Cremona
2008/9/9 Martin Albrecht <[EMAIL PROTECTED]> > > > I had thought that the job of not repeatedly evaluating constants > > which appear in the loop termination conditions should be a *python* > > issue, not a Sage preprocessing one. Can we not ask the python people > > to fix it and wait? > > AFAIK

[sage-devel] Re: real number parsing issue

2008-09-09 Thread Martin Albrecht
> I had thought that the job of not repeatedly evaluating constants > which appear in the loop termination conditions should be a *python* > issue, not a Sage preprocessing one. Can we not ask the python people > to fix it and wait? AFAIK, they already do that if there is a real constant in the

[sage-devel] Re: real number parsing issue

2008-09-09 Thread John Cremona
2008/9/9 Martin Albrecht <[EMAIL PROTECTED]>: > > On Tuesday 09 September 2008, William Stein wrote: >> > On a related note, recently I wrote a simple loop that went something >> > like this: >> > >> > while abs(err) < 1e-6: >> > ... >> > >> > The most expensive part of the operation, by far,

[sage-devel] Re: real number parsing issue

2008-09-09 Thread Martin Albrecht
On Tuesday 09 September 2008, William Stein wrote: > > On a related note, recently I wrote a simple loop that went something > > like this: > > > > while abs(err) < 1e-6: > > ... > > > > The most expensive part of the operation, by far, was computing > > RealNumber('1e-6') in every iteration o

[sage-devel] Re: real number parsing issue

2008-09-08 Thread Robert Bradshaw
On Sep 8, 2008, at 2:00 PM, John Cremona wrote: > To me it sounds very complicated to keep a memory of what string a > real number was first created with... but Sage already does a lot of > complicated things! Wasn't too hard to do, anyone want to review? http://trac.sagemath.org/sage_trac/tick

[sage-devel] Re: real number parsing issue

2008-09-08 Thread William Stein
> On a related note, recently I wrote a simple loop that went something like > this: > > while abs(err) < 1e-6: > ... > > The most expensive part of the operation, by far, was computing > RealNumber('1e-6') in every iteration of the loop. What would people think > about pulling such constants

[sage-devel] Re: real number parsing issue

2008-09-08 Thread John Cremona
To me it sounds very complicated to keep a memory of what string a real number was first created with... but Sage already does a lot of complicated things! 2008/9/8 Robert Bradshaw <[EMAIL PROTECTED]>: > Yep. This has bothered me too. The basic idea would be to have > RealNumber(x) return a wrap

[sage-devel] Re: real number parsing issue

2008-09-08 Thread Robert Bradshaw
On Sun, 7 Sep 2008, William Stein wrote: > > On Sun, Sep 7, 2008 at 6:12 AM, John Cremona <[EMAIL PROTECTED]> wrote: >> >> This is unfortunate: >> >> sage: R256=RealField(256) >> sage: R256('1.2') >> 1.200 >> sage: R256(1.2)

[sage-devel] Re: real number parsing issue

2008-09-07 Thread William Stein
On Sun, Sep 7, 2008 at 6:12 AM, John Cremona <[EMAIL PROTECTED]> wrote: > > This is unfortunate: > > sage: R256=RealField(256) > sage: R256('1.2') > 1.200 > sage: R256(1.2) > 1.1999555910790149937383830547332763671