HP Forums

Full Version: Moving from 200LX SOLVER to SAGEmath *)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Dear fellow SOLVER users,

any idea, how to move (solve!) a construct like

Code:
if(S(SvNow)
:inv(1+if(Save1=0:%AgSvTarget:%AgSvNow)/100)
:inv(1+%AgSvNow/100)
)

to (in) SAGEmath?

Best regards

*) http://sagemath.wikispaces.com/if
Answering myself - Python's identation and variable naming were the stoppers ;-)

Not being allowed to use the % character in variable names, makes developing self-documenting code for financial tasks in SAGEmath a bit harder too.

(print statements added to visualize decision tree)

Code:
var ('S, Save1, _AgSvTarget, _AgSvNow')
_AgSvTarget=5; _AgSvNow=3.0; S=1; Save1=0.0

if S == 1: 
    if Save1 == 0:
        print 1,  1/(1 + _AgSvTarget/100)
    else:
        print 2,  1/(1 + _AgSvNow/100)        
else:    
    print 3,  1/(1 + _AgSvNow/100)

Best regards
(01-11-2015 12:30 PM)Peter A. Gebhardt Wrote: [ -> ]Python's indentation and variable naming were the stoppers ;-)

And I was thinking the problem is the S (solving for) function.

Cheers
Thomas
Reference URL's