On Mon, Jun 2, 2008 at 3:19 PM, John Cremona <[EMAIL PROTECTED]> wrote:
>
> 2008/6/2 William Stein <[EMAIL PROTECTED]>:
>>
>> On Mon, Jun 2, 2008 at 12:53 PM, Gary Furnish <[EMAIL PROTECTED]> wrote:
>>>
>>> -1. First, everything cwitty said is correct.  Second, if we start
>>> using ZZ[sqrt(2)] and ZZ[sqrt(3)], then sqrt(2)+sqrt(3) requires going
>>> through the coercion system which was designed to be elegant instead
>>> of fast, so this becomes insanely slow for any serious use.  Finally,
>>> this is going to require serious code duplication from symbolics, so
>>> I'm not sure what the big gain is over just using symbolics to do this
>>> in the first place.
>>
>> Also, cwitty pointed out that
>>
>> sage: sum([sqrt(p) for p in prime_range(1000)])
>>
>> works fine in Sage now, but with your (and my) proposal,
>> it would be impossible, since it would require constructing
>> a ring of integers of a number field of degree 2^168..
>
> Surely that is something which we can train users not to do?

Why?

 Doing that sum works fine now.  It's even fun.  That
all the following work fine even with our current system
says something...

sage: a = sum([sqrt(p) for p in primes(1000)])
sage: float(a)
3307.7690992952139
sage: RDF(a)
3307.7690993
sage: RealField(1000)(a)
3307.76909929521532337080828563375122663883932558794796752652934831207623440969500409157102585876606649295101934045235119416217303162488345812238151772485033866010535293142064829106852999118135254502207045010375309268967623016528462090375140033057342943102054036545832373683901618507572426685968323860


>  I remember years ago learning the difference in pari/gp between
>
> sum(n=1,1000,1/n)
>
> and
>
> sum(n=1,1000,1.0/n)
>
> and it's a lesson which only needs to be learnt once.
>
> On the other hand pari/gp always has assumed a lot of its users, and
> Sage has aspirations to be easy to use too...
>
> John
>
>>
>>  -- William
>>
>> >
>>
>
> >
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to