Post Reply 
HP Prime: a student's view
08-31-2021, 03:41 PM
Post: #14
RE: HP Prime: a student's view
(08-31-2021 03:14 PM)Thomas_Sch Wrote:  Now I did the performance checks on my G2. Here are my programs and results.

WHILE (r0) > 0 DO

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.

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 03:41 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: 2 Guest(s)