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:
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
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
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
> 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
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,
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
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
> 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
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
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)
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
12 matches
Mail list logo