Post Reply 
How the heck do I Iterate and Emulate?
10-04-2015, 07:18 AM (This post was last modified: 10-04-2015 07:42 AM by brickviking.)
Post: #1
How the heck do I Iterate and Emulate?
I've got a HP-50G, but people have been humming about the Prime for a little while now. I installed the emulator, and I have upgraded to the 8151 version. I tried a really simple program in the HP emulator:

Code:

EXPORT ITTST()
BEGIN
LOCAL X;
PRINT("X is "+X);
ITERATE(X^2,X,2,3);
PRINT("X is now "+X);
END;

All I get as output is "X is 0" (understandable) and "X is now 0" (which is not). Clearly I'm doing something completely wrong, as I typed the ITERATE example in from the manual, yet I'm not getting the same results as the manual. I also tried it in the Home screen, ITERATE worked fine there. So, where am I going wrong?

(Post 35)

Regards, BrickViking
HP-50g |Casio fx-9750G+ |Casio fx-9750GII (SH4a)
Visit this user's website Find all posts by this user
Quote this message in a reply
10-04-2015, 08:00 AM
Post: #2
RE: How the heck do I Iterate and Emulate?
ITERATE doesn't change the value of your local variable X.
You should do:
X:=ITERATE(X^2,X,2,3);
Find all posts by this user
Quote this message in a reply
10-04-2015, 09:23 AM
Post: #3
RE: How the heck do I Iterate and Emulate?
(10-04-2015 08:00 AM)Didier Lachieze Wrote:  ITERATE doesn't change the value of your local variable X.
You should do:
X:=ITERATE(X^2,X,2,3);

Ahh, that would explain that. So it's a bit more like PASCAL than I previously thought. Thank you.

(Post 36)

Regards, BrickViking
HP-50g |Casio fx-9750G+ |Casio fx-9750GII (SH4a)
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)