On Sep 18, 2:10 pm, "Mike Hansen" <[EMAIL PROTECTED]> wrote:
> How about providing a sum function that would behave like, say, the
> integrate function. It could detect the argument types so if you
> passed it a list, it'd behave the same as the builtin sum function.
>
> sage: integrate(x, x, 0,
BTW, matlab has 1-based indexing too. Maple has both: there is an
array object that can be 0,1,2,... based and a List object that is
1-based. I think it would be nice to have an iterator object similar
to (1:n) in matlab (but not a list object).
didier
2007/9/18, Joel B. Mohler <[EMAIL PROTECTED
On Tuesday 18 September 2007 14:34, Robert Bradshaw wrote:
> I still like the [a..b] notation that makes
> things totally obvious, and I am as surprised as Peter Doyle at the
> shift of topic of whether or not indices should be 0-based (which we
> don't have a choice about while sticking wi
How about providing a sum function that would behave like, say, the
integrate function. It could detect the argument types so if you
passed it a list, it'd behave the same as the builtin sum function.
sage: integrate(x, x, 0, 10)
50
sage: sum(x, x, 0, 10)
55
sage: sum(range(10))
45
I'm having t
On Sep 18, 2007, at 11:22 AM, Jaap Spies wrote:
> William Stein wrote:
>> -- Forwarded message --
>> From: Peter Doyle (a Professor at Dartmouth)
>> Date: Sep 18, 2007 10:32 AM
>> Subject: Re: Calculus
>> To: William Stein <[EMAIL PROTECTED]>
>>
>> Hi William,
>>
>>> There was a
Robert Bradshaw wrote:
>> Why not define a new function srange (short for sagerange),
>> or redefine the existing srange function:
>>
>> def srange(a,b=None,step=1, include_endpoint=True):
>>
>> or something like that.
>>
>> See sage: srange??
>>
>> Alternative: reuse xrange
>> this function will
William Stein wrote:
> -- Forwarded message --
> From: Peter Doyle (a Professor at Dartmouth)
> Date: Sep 18, 2007 10:32 AM
> Subject: Re: Calculus
> To: William Stein <[EMAIL PROTECTED]>
>
> Hi William,
>
>> There was a long thread on sage-devel about this:
>>
>>
> http://group