Dear all,
Could anyone tell me how to controll the order in which arguments are
evaluated when they are passed to python functions? It seems that the
functions are evaluated first and then the variables are substituted,
which leads to failures in the following example:
var('c')
def piece(c,x):
if x < 1.:
return c*x^2
if x >= 1.:
return 1/x-c
plot(piece(0.2,x),0,2)
Traceback (click to the left for traceback)
...
TypeError: no way to make fast_float from None
numerical_integral(piece(0.2,x),0,2)
Traceback (click to the left for traceback)
...
TypeError: a float is required
How can I get sage to substitute the values for x before calling piece
(0.2,x)?
Thanks for your help!
Stan
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---