Post Reply 
HP Prime: a student's view
08-31-2021, 04:13 PM
Post: #16
RE: HP Prime: a student's view
(08-31-2021 04:06 PM)Thomas_Sch Wrote:  
(08-31-2021 03:41 PM)toml_12953 Wrote:  Although it works the same in this particular case, in general, this isn't the same as
Code:
while True
# do something
if r0<=0:
  exit

Why? Suppose r0 =-4 when the code reaches the while statement. What will your loop do? What will mine do?

Yours isn't executed at all if r0 <=0. The example from the website and my example will execute the loop at least once.

Many thanks, this is correct.

Did you find out why your results are so different?
("I only get 17,340.68 ...")

Not yet. Why don't I run your code and you run mine to see if the results agree?

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP Prime: a student's view - Liam Hays - 08-30-2021, 01:11 AM
RE: HP Prime: a student's view - Liam Hays - 08-31-2021, 01:30 AM
RE: HP Prime: a student's view - toml_12953 - 08-31-2021 04:13 PM
RE: HP Prime: a student's view - parisse - 08-31-2021, 07:30 PM
RE: HP Prime: a student's view - Liam Hays - 08-31-2021, 11:20 PM
RE: HP Prime: a student's view - jte - 09-01-2021, 10:43 PM
RE: HP Prime: a student's view - Liam Hays - 09-03-2021, 01:31 AM
RE: HP Prime: a student's view - jte - 09-05-2021, 03:44 PM
RE: HP Prime: a student's view - jte - 09-05-2021, 06:16 AM
RE: HP Prime: a student's view - pinkman - 09-03-2021, 09:30 PM
RE: HP Prime: a student's view - Liam Hays - 09-04-2021, 01:30 AM
RE: HP Prime: a student's view - Liam Hays - 09-04-2021, 04:49 PM
RE: HP Prime: a student's view - ijabbott - 09-04-2021, 08:44 AM



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