Santanu Sarkar <[email protected]> writes:

> No, as s will be a function of a,m,t,

You can't have imperative code in a symbolic function, if that's what
you're asking. You can of course use an imperative (Python) function to
do what you want::

    def s(m, a, t):
        result = 0
        for i in srange(1,m+1):
            if i > a + t:
                s += 2*i
            else:
                s += t
        return result

But now this function cannot be used in some places where a symbolic
expression could. For example you will be hard pressed to plot a partial
evaluation of it without some wrapping gymnastics.

-Keshav

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.


Reply via email to