xoctan657 Posted March 20, 2009 Share Posted March 20, 2009 (edited) hi evryone i want to know if there are any expression can give me a value lik this: ($CY)*($CY - 1)*($CY - 2)*($CY - 3)*($CY - 4).....................................($CY-{$NCY-1}) so if any one know please help ..........and thanks very much...................................... Edited March 20, 2009 by xoctan657 Quote Link to comment Share on other sites More sharing options...
stevenong Posted March 20, 2009 Share Posted March 20, 2009 Can you describe exactly what you're trying to do please? Why do you need that type of expression? What's the purpose? There might be other ways of doing what you want. Cheers! steven Quote Link to comment Share on other sites More sharing options...
xoctan657 Posted March 20, 2009 Author Share Posted March 20, 2009 (edited) Can you describe exactly what you're trying to do please? Why do you need that type of expression? What's the purpose? There might be other ways of doing what you want.Cheers! steven i did what i wanted just a few minuts back but anyway it will be helpfull if there are like this expression: if we have $NCY=6 so with $CY=5 it will give me this value: ($CY)*($CY - 1)*($CY - 2)*($CY - 3)*($CY - 4) and for $CY=4 give : ($CY)*($CY - 1)*($CY - 2)*($CY - 3) and for $CY=3 give : ($CY)*($CY - 1)*($CY - 2) and ..................................like this as in the Combination in the mathematics http://en.wikipedia.org/wiki/Combination Edited March 20, 2009 by xoctan657 Quote Link to comment Share on other sites More sharing options...
ranxerox Posted March 20, 2009 Share Posted March 20, 2009 so you need factorial. In python, assuming that the input is in the "tx" channel: param = int(ch("tx")) if param <= 1: return 1 fac = 1 for i in range(2,param+1): fac = fac * i return fac i did what i wanted just a few minuts back but anyway it will be helpfull if there are like this expression:if we have $NCY=6 so with $CY=5 it will give me this value: ($CY)*($CY - 1)*($CY - 2)*($CY - 3)*($CY - 4) and for $CY=4 give : ($CY)*($CY - 1)*($CY - 2)*($CY - 3) and for $CY=3 give : ($CY)*($CY - 1)*($CY - 2) and ..................................like this as in the Combination in the mathematics http://en.wikipedia.org/wiki/Combination Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.