Fibonacci sequence by recursive algorithm fail
|
04-21-2015, 02:20 PM
(This post was last modified: 04-21-2015 03:31 PM by compsystems.)
Post: #10
|
|||
|
|||
RE: Fibonacci sequence by recursive algorithm fail
Sorry for my bad English
I found the real problem, works well (CAS PROG) if everything is written in lowercase or all uppercase and, in single shift and does not work (if then else end → If Then Else End) HP TEAM must review the compiler (CAS PROG) for next versión of firmware, the following code is successfully compiled, but fails to run, you must verify that the commands are well written Code: #CAS fibo_cas(16) → "Error: Bad argument count" ? What affects capitalized If, the algorithm? ------- I found a serious problem, if two functions prog HOME or prog CAS, has the same name appears only version HOME. The only solution is to support working directories for next versión of firmware (DIR nameDir .... EndDir) do you agree? PROBLEM WITH TWO FOLLOWING CODES, try it yourself Code: #CAS Code: export fibo(n) --------------------- OK codes Code: #CAS fibo_cas(16) → 987.0 Code: export fibo_home(n) Or Code: export fibo_home2(n) (04-21-2015 01:57 PM)DrD Wrote: I think a case could be made that a CAS program is not a good construct for this kind of algorithm. Personally, I think that CAS programs are better suited for CAS exclusive purposes (remaining within the CAS environment). Just to use one type CAS program if the output is symbolic is obligatory, if only numerical output is optional For example the following code can not code as HOME program Code: #CAS a tip, if the return command have parentheses, returns the output is in exact format, otherwise the approx Code: #CAS |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)