Post Reply 
Recursive programs in XCAS.
02-12-2017, 02:32 AM (This post was last modified: 02-12-2017 02:33 AM by John P.)
Post: #4
RE: Recursive programs in XCAS.
(02-12-2017 01:41 AM)Han Wrote:  Can you provide a bit more information on what you have tried? Perhaps a snippet of code might provide a better idea of what you are trying to achieve. Or even a better description of what you wan to do beyond a generic description of "recursive program."

Fibonnaci example
Code:

fibon(n):=
begin
  if (n == 1) then return(1); end;
  if (n == 2) then return(1); end;
  if (n > 2) then
    return( fibon(n-1) + fibon(n-2) );  
  end;
end;

In general, any CAS code on the HP Prime should port as easily as copy/paste -- WITH EXCEPTIONS FOR A FEW COMMANDS (e.g. idenmat() on xcas is identity() )

Yes, the example of fibon() you provided works on my iPhone 6+ so, recursive programs are possible in PocketCAS. I must be making some mistake(s) in porting the program.
Thank you very much.
John P
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Recursive programs in XCAS. - John P - 02-12-2017, 12:22 AM
RE: Recursive programs in XCAS. - Han - 02-12-2017, 01:41 AM
RE: Recursive programs in XCAS. - John P - 02-12-2017, 02:08 AM
RE: Recursive programs in XCAS. - John P - 02-12-2017 02:32 AM
RE: Recursive programs in XCAS. - Han - 02-12-2017, 02:52 AM
RE: Recursive programs in XCAS. - Han - 02-12-2017, 04:06 AM
RE: Recursive programs in XCAS. - Han - 03-01-2017, 04:46 AM
RE: Recursive programs in XCAS. - Han - 03-01-2017, 04:49 AM



User(s) browsing this thread: